Difference between revisions of "Break"
From Wiki
| Line 1: | Line 1: | ||
{{command header|Flow Control}} | {{command header|Flow Control}} | ||
| − | |||
| − | |||
| − | |||
| − | |||
{{body|Break|''break'' can be used to immediately exit any loop structure.}} | {{body|Break|''break'' can be used to immediately exit any loop structure.}} | ||
| Line 23: | Line 19: | ||
%Test will hold the value of 7, notice how we break out from the loop when %Test is 7. | %Test will hold the value of 7, notice how we break out from the loop when %Test is 7. | ||
| + | |||
| + | === Releated Commands === | ||
| + | {| style="background:beige; color:black; border: 2px #aaa solid;" | ||
| + | | Width=250px align=center | [[While]] | ||
| + | |} | ||
{{1.5only}} | {{1.5only}} | ||
{{footer|}} | {{footer|}} | ||
Revision as of 10:19, 3 August 2007
Synopsis
Break
Description
break can be used to immediately exit any loop structure.
Example
set %Test 1
while %Test < 10
{
;Code between these brackets, gets executed, while %Test is smaller than 10
;When its 10, it wont jump back to first bracket.
if %Test = 7
break
set %Test %Test + 1
}
display ok %Test $
halt
%Test will hold the value of 7, notice how we break out from the loop when %Test is 7.
Releated Commands
| While |
| Note: | Only available in EasyUO 1.5+ |
See also
| Main Page | Documentation |