(The in the previous program is the calculator’s representation for the newline character after you enter a program on the stack.)

Using INPUT, ENTER for Input

INPUT lets you use the stack area for prompting, lets you supply default input, and prevents the user from using normal stack operations or altering data on the stack.

To enter INPUT in a program:

1.Enter a string (with "" delimiters) to be displayed as a prompt at the top of the stack area.

2.Enter a string or list (with delimiters) that specifies the command-line content and behavior — see below.

3.Enter the INPUT command (PRG IN menu).

4.Enter OBJ→ (PRG TYPE menu) or other command that processes the input as a string object.

«"prompt-string""command-line" INPUT OBJ→ »

or

«"prompt-string"{command-line" INPUT OBJ→ »

INPUT, in its simplest form, takes two strings as arguments — see the list of additional options following. INPUT blanks the stack area, displays the contents of the level-2 string at the top of the stack area, and displays the contents of the level-1 string in the command line. It then activates Program-entry mode, puts the insert cursor after the string in the command line, and suspends execution.

When execution resumes, the input is returned to level 1 as a string object, called the result string.

To respond to INPUT while running a program

1.Enter your input. (You can’t execute commands — they’re simply echoed in the command line.)

2.Optional: To clear the command line and start over, press .

3.Press `.

If you execute this program segment

«"Variable name?" ":VAR:" INPUT » the display looks like this:

1-40 RPL Programming