PROMPT Statement

The PROMPT statement may be used to reassign the prompt character from its default setting of ?.

Format

PROMPT expr

Parameter(s)

expr

An expression evaluating to a single character, to be taken as the prompt character. If expr evaluates to more than one character, only the first character is used as the prompt.

Description

The character specified by a PROMPT statement is sent to the output device whenever an INPUT statement is used, to signal the operator that input is requested before execution may continue. The default prompt is ?.

Note that the prompt character is generated by each INPUT statement and not by PRINT statements.

Example

In this application, the colons (:) at the end of each PRINT statement do not designate a prompt but simply suppress the linefeed and carriage return for display purposes. The prompt character is generated by the INPUT statement, not by the PRINT statement.

PRINT "WOULD YOU LIKE TO KNOW YOUR SCORES (Y OR N)" :

INPUT ANSWER

IF ANSWER = "Y" THEN    

   PROMPT ":"   

   PRINT "FROM WHICH GAME" :   

   INPUT GAME   

   PRINT "YOUR SCORE WAS " : SCORE(GAME)  

END

The resulting output (with the operator’s input in bold) is:

DO YOU WANT TO KNOW YOUR SCORES?Y

FROM WHICH GAME:2

YOUR SCORE WAS 78

See Also

Statement and Function Reference