Difference between revisions of "Goto"

From Wiki
Jump to: navigation, search
Line 3: Line 3:
 
{{body|goto {label name}|The ''goto'' command moves the execution to another part of the script. The destination point is given by a label.}}
 
{{body|goto {label name}|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.}}
 
  
 +
{{note|
 +
*Don't goto out of a [[sub]]. Always use [[return]]! EasyUO will probably not crash but it is VERY bad programming style.
 +
*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.
 +
*Inline comments do not work with labels in EasyUO 1.4.}}
  
{{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|Inline comments do not work with labels in EasyUO 1.4.}}
 
  
 
==== Example ====
 
==== Example ====

Revision as of 05:15, 29 August 2005


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.
  • A label in the code must be followed by a colon, where as gotoing to the label does not require a following colon.
  • Inline comments do not work with labels in EasyUO 1.4.


Example

loop:
if %donotloop
	goto exit
goto loop

exit:

See also

Main Page Documentation