ECHO

ECHO

Top  Previous  Next

 

The ECHO statement enables or disables echoing of keyboard input.

 

 

Format

 

ECHO OFF

ECHO ON

ECHO expr

 

where

 

exprevaluates to a number.

 

 

Keyboard input is normally echoed to the display when it is processed by an INPUT statement. Use of ECHO OFF will suppress this echo until a subsequent ECHO ON statement. Typically, ECHO OFF is used to prevent display of passwords, etc. Turning off echo does not suppress display of the input prompt character, if enabled (see PROMPT).

 

The ECHO expr format of this statement is equivalent to ECHO ON if the value of expr is non-zero and ECHO OFF if expr is zero.

 

 

Example

 

DISPLAY "Enter password " :

ECHO OFF

INPUT PASSWORD

ECHO ON

 

This program fragment requests entry of a password with echoing inhibited. The HIDDEN option of the INPUT statement may be a better way to do this as it echoes asterisks back to the terminal.

 

 

See also:

INPUT, INPUT @