|
| ||||||||||
| Tags: goto loop, vb script |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| VB script - GOTO Do Loop - possible to acheive?
I tried to do a new way of looping, that even after an exit, the loop can be entered again, without having to copy the whole do...loop area. I've been googling on this, but nothing really worked out.People tell me it's not possible, but that's hard to believe. Is it possible to enter a loop after exiting it? |
|
#2
| |||
| |||
| Re: VB script - GOTO Do Loop - possible to acheive?
Hi friend, I would suggest that the loop would be a point where the loop starts right before your do loop that you want to re-enter. If the written code does not work for your situation, then go for a Goto Loop because eventhough it is seems very easy but its working is quite complicated,since it provides more then one entrance to a loop on a flowchart. |
|
#3
| |||
| |||
| Re: VB script - GOTO Do Loop - possible to acheive?
I provide some little more information about the looping concept There is a way in VB - I assume it works in VBS also. msgbox "Begin" if err.description <> nothing goto Errorhandler msgbox "No error" exit function Errorhandler : msgbox "Error Handled" This would take you to the Errorhandler, when there has been an error, otherwise it won't go to the sub. (Obviously, change to if err.description =nothing goto Errorhandler to test functionality). |
|
#4
| |||
| |||
| Re: VB script - GOTO Do Loop - possible to acheive?
That's a good idea. I suppose this is been used for bigger project, but I just needed a goto do-loop fast, for a few simple lines of script. Thanks for the tip. |
|
#5
| |||
| |||
| Re: VB script - GOTO Do Loop - possible to acheive?
There is no good reason for wanting a goto (except exceptions that need on error as said before in VBScript) against existing code flow instructions. You can use Do [while loop] Exit Do Loop [until condition satisfies] Select Case do Case Case Else End Select If Then ElseIf Then Else End If These all above loops also provides the same purpose. |
|
#6
| ||||
| ||||
| Re: VB script - GOTO Do Loop - possible to acheive?
You may also get the relevant information about the VB Script from the MSDN library just have a look at the following link. http://msdn.microsoft.com/en-us/library/t0aew7h6.aspx |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "VB script - GOTO Do Loop - possible to acheive?" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Excel Macro to loop a script | JFN | Software Development | 1 | 27-04-2010 10:06 AM |
| Java - goto or continue | Miles Runner | Software Development | 5 | 16-01-2010 09:47 AM |
| How to Acheive Windows Recovery through DVD | Jamaima | Operating Systems | 3 | 02-03-2009 10:14 AM |
| Help with sh script loop counting | Brake Fail | Software Development | 3 | 10-01-2009 05:48 PM |
| How to create a script in a DOS batch file to do a loop? | Jon Osborn | Windows Server Help | 2 | 27-05-2008 06:41 PM |