1-40 RPL Programming
!fIcommand-lineI!cursor-position operating-options!h!
“Command-
line”
Specifies the content of the command line when the program pauses. Embedded
newline characters produce multiple lines in the display. (If not included, the
command line is blank.)
Cursor-
position
Specifies the position of the cursor in the command line and its type. (If not included,
an insert cursor is at the end of the command line.)
! A real number n specifies the nth character in the first row (line) of the command
line. Zero specifies the end of the command-line string. A positive number specifies
the insert cursor — a negative number specifies the replace cursor.
! A list frow characterh specifies the row and character position. Row 1 is the first row
(line) of the command line. Characters count from
the left end of each row — character 0 specifies the end of the row. A positive row
number specifies the insert cursor — a negative row number specifies the replace
cursor.
operating-
options
Specify the input setup and processing using zero or more of these unquoted names:
! BE> activates Algebraic/Program-entry mode (for algebraic syntax). (If not included,
Program-entry mode is active.)
! v (~…a) specifies alpha lock. (If not included, alpha is inactive.)
! N verifies whether the result string (without the IIdelimiters) is a valid object or
sequence of objects. If the result string isn't valid, INPUT displays the
6Gw$ut(!D@Gp$? message and prompts again for data. (if not included, syntax
isn't checked.)
To design the command-line string for INPUT:
! For simple input, use a string that produces a valid object:
" Use an empty string
" Use a llabel l tag.
" Use a x text x comment.
! For special input, use a string that produces a recognizable pattern.
After the user enters input in the command line and presses ` to resume execution, the contents of the
command line are returned to level 1 as the result string. The result string normally contains the original
command-line string, too. If you design the command-line string carefully, you can ease the process of
extracting the input data.
To process the result string from INPUT:
! For simple input, use OBJ" to convert the string into its corresponding objects.
! For sensitive input, use the N option for INPUT to check for valid objects, then use OBJ" to convert the
string into those objects.
! For special input, process the input as a string object, possibly extracting data as substrings.
Example: The program VSPH on page 1-39 uses an empty command-line string.
Example: The program SSEC on page 1-42 uses a command-line string whose characters form a pattern. The
program extracts substrings from the result string.