Reference Guide

Full Command and Function Reference 3-65
Input/Output:
Level 1/Argument 1 Level 1/Item 1
DO
UNTIL
END
T/F
Example: The following program counts down from 100 to 0 and leaves the integers 100 to 0 on the stack:
« 100 'A' STO A DO 'A' DECR UNTIL 'A==0' END 'A' PURGE »
See also: END, UNTIL, WHILE
DOERR
Type: Command
Description: Do Error Command: Executes a “user-specified” error, causing a program to behave exactly as if
a normal error had occurred during program execution.
DOERR causes a program to behave exactly as if a normal error has occurred during program
execution. The error message depends on the argument provided to DOERR:
n
error
or #n
error
display the corresponding built-in error message.
"error" displays the contents of the string. (A subsequent execution of ERRM returns "error".
ERRN returns # 70000h.)
0 abandons program execution with an ‘interrupted’ error message (ERRN = #13Fh).
0 DOERR is equivalent to pressing .
Access: !°LL
ERROR DOERR
( °is the left-shift of the Nkey).
Input/Output:
Level 1/Argument 1 Level 1/Item 1
n
error
#n
error
“error”
0
Example: The following program takes a number from the stack and returns an error if the number is
greater than 10:
« → X « CASE 'X>10' THEN "X IS TOO BIG" DOERR END END » »
See also: ERRM, ERRN, ERR0
DOLIST
Type: Command
Description: Do to List Command: Applies commands, programs, or user-defined functions to lists.
The number of lists, n, can be omitted when the first or level 1 argument is any of the following:
A command.
A program containing exactly one command (e.g. « DUP »)
A program conforming to the structure of a user-defined function.
The final argument 1 (or level 1 object) can be a local or global name that refers to a program or
command.
All lists must be the same length l. The program is executed l times: on the ith iteration, n objects
each taken from the ith position in each list are entered on the stack in the same order as in their
original lists, and the program is executed. The results from each execution are left on the stack.
After the final iteration, any new results are combined into a single list.
Access:
LIST PROCEDURES DOLIST
( °is the left-shift of the Nkey).