Programmer Guide/Command Reference/FOREVER: Difference between revisions

From STX Wiki
Jump to navigationJump to search
m (1 revision: Initial import)
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
==FOREVER==
The <code>FOREVER</code>, or <code>DO FOREVER</code> statement starts a, potentially infinite, loop. The commands between <code>FOREVER</code> or <code>DO FOREVER</code> and the corresponding <code>[[Programmer_Guide/Command_Reference/END|END]]</code> statement are being executed forever, or until execution of the loop gets interrupted by other means, e.g. by S_TOOLS-STx crashing, a <code>[[Programmer Guide/Command Reference/BREAK|BREAK]]</code> statement being encountered, or an <code>[[Programmer Guide/Command Reference/EXIT|EXIT]]</code>, or a  [[Programmer Guide/Command Reference/GOTO|GOTO]] statement being executed.
 
FOREVER
<code>FOREVER | DO FOREVER</code>
or
 
DO FOREVER
Repeat commands between <code>FOREVER</code> and <code><code>END</code> forever.</code>
Cave: If you do ''not'' use a <code>[[Programmer Guide/Command Reference/BREAK|BREAK]]</code>,<code>EXIT</code>, or [[Programmer Guide/Command Reference/GOTO|GOTO]] command for interrupting the loop, it may run for a really long time.
 
A loop is started with the <code>DO</code> command and stopped with <code>[[Programmer Guide/Command Reference/END|END]]</code>. The commands <code>[[Programmer Guide/Command Reference/BREAK|BREAK]]</code> and <code>[[Programmer Guide/Command Reference/CONTINUE|CONTINUE]]</code> described above are especially for use in loops. You can use a <code>[[Programmer Guide/Command Reference/GOTO and GOSUB|GOTO]]</code> command inside a loop to jump out of the loop.

Revision as of 19:23, 23 March 2011

The FOREVER, or DO FOREVER statement starts a, potentially infinite, loop. The commands between FOREVER or DO FOREVER and the corresponding END statement are being executed forever, or until execution of the loop gets interrupted by other means, e.g. by S_TOOLS-STx crashing, a BREAK statement being encountered, or an EXIT, or a GOTO statement being executed.

FOREVER

or

DO FOREVER

Cave: If you do not use a BREAK,EXIT, or GOTO command for interrupting the loop, it may run for a really long time.

Navigation menu

Personal tools