|
-
Apr 10th, 2005, 06:14 AM
#1
Thread Starter
Addicted Member
[Resolved] Is there a [goto] function in vbscript?
is there a way of using 'goto' in vbscript?
Last edited by ajames; Apr 12th, 2005 at 11:28 AM.
-
Apr 10th, 2005, 09:52 AM
#2
Hyperactive Member
Re: Is there a [goto] function in vbscript?
The only Goto supported in VBScript is with error handling:
"I don't want to live alone until I'm married" - M.M.R.P
-
Apr 11th, 2005, 04:07 PM
#3
Thread Starter
Addicted Member
Re: Is there a [goto] function in vbscript?
so is there any way of getting Call...Sub?
-
Apr 11th, 2005, 04:24 PM
#4
Hyperactive Member
Re: Is there a [goto] function in vbscript?
"I don't want to live alone until I'm married" - M.M.R.P
-
Apr 12th, 2005, 05:58 AM
#5
Thread Starter
Addicted Member
Re: Is there a [goto] function in vbscript?
for example:
Code:
if cheese = 0 then call bob
sub bob
msgBox "hello"
-
Apr 12th, 2005, 06:10 AM
#6
Frenzied Member
Re: Is there a [goto] function in vbscript?
I'm not aware of a goto function but you can call subroutines and functions:
Code:
Sub MySub
'Do stuff here
End Sub
Call MySub
HTH
DJ
If I have been helpful please rate my post. If I haven't tell me!
-
Jul 18th, 2011, 09:43 AM
#7
New Member
Re: [Resolved] Is there a [goto] function in vbscript?
In short, no. GoTo exists, but it cannot be used like this:
START:
GoTo START
It's use in VBScript is limited to error handling. Error handling is 'turned on' like this:
On Error Resume Next
(This has nothing to do with the For ... Next loop by the way). And turned off like this:
On Error GoTo 0
That's it. As you may know, the GoTo keyword is not required and all things that can be programmed with it can be programmed without it. Personally I think the option should be there for those of us who understand its uses and are intelligent enough not to create spaghetti code, but there we are.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|