User Tools

Site Tools


4rpl:commands:repeat

This is an old revision of the document!


Index

repeat

Repeat

Description

Part of the “while: loop construct. Pops an item from the stack. If true, execute the following statements. If false, jump to the statement following ‘endwhile’.

Examples

5 ->y
while
    <-y gt(0)        #is y greater than zero?
repeat              #repeat this section of code
    trace(<-y)
    <-y sub(1) ->y   #subtract 1 from y so we don't end in infinite loop
endwhile

Index

4rpl/commands/repeat.1610121708.txt.gz · Last modified: 2021/01/08 11:01 by 127.0.0.1