1.08 Loops, Links and Branches

Loop Control:

for counter = start to end [by incr] [do] … [end]
for [each] element in array [do] … [end]
for times [do] … [end]

Defines a for loop.

do while expr … [end]
while expr [do] … [end]

Defines a do while loop.

do until expr … [end]
until expr [do] … [end]

Defines a do until loop.


exit [for|loop|sub|func]

Exits a multiline function definition, a loop, or a subprogram.

Subroutines

In addition to user defined procedures and functions it is also possible to link to a subroutine within the same section of code using the CALL command. The subroutine starts with a label and runs until a RETURN command is found.

Processing returns to the statement following the CALL command.

Branching

The GOTO command is also available to branch to a label, but should not normally be used.

See 2.09 Branching and Linking for details.


lynplex/lp0108.txt · Last modified: 2012/08/22 09:01 (external edit)