You can delete names and numbers by editing the NAMES variable.

To improve upon this program, create a delete name routine.

Beeping to Get Attention

To enter BEEP in a program:

1.Enter a number that specifies the tone frequency in hertz.

2.Enter a number that specifies the tone duration in seconds.

3.Enter the BEEP command (!°L%OUT% Lmenu).

«frequency duration BEEP »

BEEP takes two arguments from the stack: the tone frequency from level 2 and the tone duration from level 1.

Example: The following edited version of TPROMPT sounds a 440-hertz, one-half-second tone at the prompt for data input.

Program:

Comments:

 

 

«

 

"ENTER a, b IN ORDER:"

Sounds a tone just

440 .5 BEEP

before the prompt for

PROMPT

data input.

TORSA

 

»

 

 

 

Stopping a Program for Keystroke Input

A program can stop for keystroke input — it can wait for the user to press a key. You can do this with the WAIT and KEY commands.

Using WAIT for Keystroke Input

The WAIT command normally suspends execution for a specified number of seconds. However, you can specify that it wait indefinitely until a key is pressed.

To enter WAIT in a program

To stop without changing the display, enter 0 and the WAIT command (PRG IN menu).

To stop and display the current menu, enter –1 and the WAIT command (PRG IN menu).

WAIT takes the 0 or –1 from level 1, then suspends execution until a valid keystroke is executed.

For an argument of –1, WAIT displays the currently specified menu. This lets you build and display a menu of user choices while the program is paused. (A menu built with MENU or TMENU is not normally displayed until the program ends or is halted.)

When execution resumes, the three-digit key location number of the pressed key is left on the stack. This number indicates the row, column, and shift level of the key.

To respond to WAIT while running a program:

Press any valid keystroke. (A prefix key such as !or ~by itself is not a valid keystroke.)

1-48 RPL Programming