Chapter 13. Control Structures

Control Commands
RUN
RUNRESULT
REPEAT
REPCOUNT
IF
IFELSE
TEST
IFTRUE
IFFALSE
TRUE
FALSE
STOP
OUTPUT
CATCH
THROW
ERROR
PAUSE
CONTINUE
YIELD
NOYIELD
EVENTCHECK
SETCURSORWAIT
SETCURSORNOWAIT
HALT
WAIT
SETTIMER
CLEARTIMER
BYE
.MAYBEOUTPUT
IGNORE
`
FOR
FOREVER
DO.WHILE
WHILE
DO.UNTIL
UNTIL
Template-Based Iteration
Explicit-Slot Templates
Named-Procedure Templates
Named-Slot Templates
APPLY
INVOKE
FOREACH
MAP
MAP.SE
FILTER
FIND
REDUCE
CROSSMAP
CASCADE
CASCADE.2
TRANSFER
ISEQ
RSEQ
#
?

Logo has many facilities for controlling which instructions get executed next. Taken together, these facilities are commonly called "control flow", because they control the "flow" of execution.

In the following descriptions, an "instruction list" input may be a list or a word. If it's a word, it is parsed into list form before it is run. Thus, RUN READWORD or RUN READLIST work. The former is slightly preferable because it allows for a continued line (with ~) that includes a comment (with ;) on the first line.

Pay attention to the difference between an "operation" and a "command". An operation is a procedure that outputs a value. A command is a procedure that does NOT output a value. Most procedures are either one or the other, but some are both.


SourceForge.net Logo