Difference between revisions of "Goto"

From Wiki
Jump to: navigation, search
 
(Description)
Line 7: Line 7:
 
=== Description ===
 
=== Description ===
 
The [[goto]] command moves the execution to another part of the script. The destination point is given by a label.
 
The [[goto]] command moves the execution to another part of the script. The destination point is given by a label.
 +
 +
''NOTE: Don't [[goto]] out of a [[sub]]. Always use [[return]]! EasyUO will probably not crash but it is VERY bad programming style.''
  
 
===== Labels =====
 
===== Labels =====
Line 12: Line 14:
  
 
''NOTE: a label in the code must be followed by a colon, where as gotoing to the label does <b>not</b> require a following colon.''
 
''NOTE: a label in the code must be followed by a colon, where as gotoing to the label does <b>not</b> require a following colon.''
 +
 +
''ANOTHER NOTE: Currently, inline comments don't work with labels (this'll get fixed in a future update).''
  
 
==== Example ====
 
==== Example ====

Revision as of 22:45, 13 August 2005

goto

Flow Control

Synopsis

goto {label name}

Description

The goto command moves the execution to another part of the script. The destination point is given by a label.

NOTE: Don't goto out of a sub. Always use return! EasyUO will probably not crash but it is VERY bad programming style.

Labels

A label specifies a point in the code where you can goto to.

NOTE: a label in the code must be followed by a colon, where as gotoing to the label does not require a following colon.

ANOTHER NOTE: Currently, inline comments don't work with labels (this'll get fixed in a future update).

Example

loop:
if %donotloop
	goto exit
goto loop

exit:

See Also


Main_Page Documentation

Flow Control