Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use GOTO command?

Status
Not open for further replies.

khmerboi83

Technical User
Aug 20, 2009
3
0
0
US
Do any know how to use the GOTO command. Please give example. I am a rookie... Thank you in advance......
 
This script is from the help file discussion on goto:

proc main
integer Loops = 0 ; Integer to count loops.

Label: ; Define a label to jump to.
Loops++ ; Increment our loop counter.
if Loops < 3 ; If the number of loops is still
goto Label ; less than 3, jump to label.
endif
usermsg "%d" Loops ; Display number of loops.
endproc

The way goto works is that it jumps to the label specified. In the example above, the line that says "Label:" is where the script would jump.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top