GoTo in VBScript?

R

Ron Hinds

Although InterDev syntax highlights GoTo as a keyword, it isn't supported in
VBScript. I'm wondering if anyone has a clever workaround for this
limitation? TIA!
 
J

Jeff Cochran

Although InterDev syntax highlights GoTo as a keyword, it isn't supported in
VBScript. I'm wondering if anyone has a clever workaround for this
limitation?

Work around how? Do you want to emulate a "GoTo"? Or not have it
highlighted?

Jeff
 
M

McKirahan

Ron Hinds said:
Although InterDev syntax highlights GoTo as a keyword, it isn't supported in
VBScript. I'm wondering if anyone has a clever workaround for this
limitation? TIA!

"GoTo" is used within "On Error GoTo 0" which resets "On Error Resume Next".
 
E

Egbert Nierop \(MVP for IIS\)

Ron Hinds said:
Although InterDev syntax highlights GoTo as a keyword, it isn't supported
in
VBScript. I'm wondering if anyone has a clever workaround for this
limitation? TIA!

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 blah]
Exit Do
Loop [until blah]

Select Case
Case blah
Case Else
End Select

If blah Then
ElseIf blah2 Then
Else
End If
 
E

Evertjan.

Ron Hinds wrote on 07 jun 2006 in
microsoft.public.inetserver.asp.general:
Although InterDev syntax highlights GoTo as a keyword, it isn't
supported in VBScript. I'm wondering if anyone has a clever workaround
for this limitation? TIA!

It is not a limitation.

Goto gives terrible programming:
<http://www.rug.nl/rc/organisatie/pictogram/archief/2002-
05/afbeeldingen/fortran.jpg>

Prof. Edsger Wybe Dijkstra said 1968 that the "goto" syntax was the
killer of higher languages, meaning any higher than primitive assembler.

<http://en.wikipedia.org/wiki/Edsger_Dijkstra>
<http://david.tribble.com/text/goto.html>
<http://www.cs.utexas.edu/users/EWD/>

Modularity later became the buzzword.

VB/VBS never implemented "goto", and I agree, it was the savior act of
BASIC.

Goto makes a computer language a untestable mess. It prevents the
cascading black boxes that can be separately tested and reused. It
prohibits efficient compiling.

Small remnants of goto, that are usefull can be felt in:

exit function
exit for

efficient because they do not hinder modularity.

================

on error goto 0

is a remnant of

on error goto 200

[all goto-s ponted to line numbers at first,
when line labeling was not invented]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,141
Messages
2,570,817
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top