PROMPT

PROMPT

Top  Previous  Next

 

The PROMPT statement sets the character to be used as the prompt in INPUT statements.

 

 

Format

 

PROMPT expr

 

where

 

exprevaluates to the character to be used.

 

 

The first character of expr is used as the prompt character. If expr is a null string, the prompt is suppressed.

 

The default input prompt is the question mark. Changes to the prompt character remain in effect until the program returns to the command prompt.

 

On ECS mode systems, attempting to set the prompt to a double width character will be ignored.

 

Use of EXECUTE to start a new command processing layer resets the prompt to a question mark but it will be restored to its previous value on return from the executed command.

 

 

Example

 

DISPLAY "Enter account number " :

PROMPT ""

INPUT ACCOUNT.NO

PROMPT "?"

 

This program fragment suppresses the prompt for the INPUT statement and then restores the default prompt character. In normal usage, a program would use the PROMPT statement once at the start of the program to set the prompt character to be used for the entire program.