Programmer Guide/Command Reference/CONTINUE: Difference between revisions

From STX Wiki
Jump to navigationJump to search
m (1 revision: Initial import)
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
==CONTINUE==
The <code>CONTINUE</code> command skips the rest of the body of a loop, effectively continuing execution with the next iteration of the respective loop(see <code>[[Programmer Guide/Command Reference/DO|DO]]</code>, <code>[[Programmer_Guide/Command_Reference/WHILE|WHILE]]</code>, <code>[[Programmer_Guide/Command_Reference/FOREVER|FOREVER]]</code>, and <code>[[Programmer_Guide/Command_Reference/FOR|FOR]]</code>). Obviously, this command may only be used inside a loop.


<code>CONTINUE</code>
=== Example ===
 
for #i := 0 to $#i < $#t[] step #i := int $#i + 1
Skip rest of command block. Continue execution with the <code>[[Programmer Guide/Command Reference/DO|DO]]</code> or <code>[[Programmer Guide/Command Reference/FOR|FOR]]</code> statement. E.g.:
    if '$#t[$#i,ID]' <= '100' continue
 
    // do something with all IDs above 100
<pre>
end
for #i := 0 to $#i < $#t[] step #i := int $#i + 1
    if '$#t[$#i,ID]' <= '100' continue
    // do something with all IDs above 100
end
</pre>

Revision as of 16:59, 14 March 2011

The CONTINUE command skips the rest of the body of a loop, effectively continuing execution with the next iteration of the respective loop(see DO, WHILE, FOREVER, and FOR). Obviously, this command may only be used inside a loop.

Example

for #i := 0 to $#i < $#t[] step #i := int $#i + 1
    if '$#t[$#i,ID]' <= '100' continue
    // do something with all IDs above 100
end

Navigation menu

Personal tools