PROMPT statement

Syntax

PROMPT character

Description

Use the PROMPT statement to specify the character to be displayed on the screen when user input is required. If no PROMPT statement is issued, the default prompt character is the question mark ( ? ).

If character evaluates to more than one character, only the first character is significant; all others are ignored.

The prompt character becomes character when the PROMPT statement is executed. Although the value of character can change throughout the program, the prompt character remains the same until a new PROMPT statement is issued or the program ends.

Generally, data the user enters in response to the prompt appears on the screen. If the source of the input is something other than the keyboard (for example, a DATA statement), the data is displayed on the screen after the prompt character. Use PROMPT " " to prevent any prompt from being displayed. PROMPT " " also suppresses the display of input from DATA statements.

If character evaluates to the null value, no prompt appears.

Examples

Source Lines
Program Output
PROMPT "HELLO" PRINT "ENTER ANSWER ": INPUT ANS PROMPT "-" PRINT "ENTER ANSWER ": INPUT ANS PROMPT "" PRINT "ENTER ANSWER ": INPUT ANS END
ENTER ANSWER HANSWERENTER ANSWER -YESENTER ANSWER NO