DISPLAY Statement

The DISPLAY statement sends data to the terminal display screen and is identical to the PRINT statement except that it writes only to the terminal. The DISPLAY statement is identical to the CRT statement.

Format

DISPLAY print-expr

CRT print-expr

Parameter(s)

print-expr

A print expression, optionally combined with commas and colons to designate the format of the output (as described below). If print-expr is omitted, a blank line is output.

Description

The DISPLAY and CRT statements cause data to be output to the terminal screen, regardless of whether a PRINTER ON statement has been executed.

Formatted Output

Format masks may be used to provide complex output formatting specifications for variables. See FMT Function for more information. Within the CRT, DISPLAY, and PRINT statements, however, commas and colons may be used to specify tab stops and suppress linefeeds.

See PRINT Statement for examples of using commas and colons to format output.

Examples

To print the string "HELLO"… to the screen, the code might read:

DISPLAY "HELLO…"

or

CRT "HELLO…"

In the next application the DISPLAY statement is used to send output to the terminal screen even if the PRINTER ON statement had been executed.

FOR I = 1 TO 10

   DISPLAY "RESULT NUMBER " : I : " TO PRINTER (Y OR N)" :

   INPUT ANSWER

   IF ANSWER = "Y" THEN

      PRINTER ON

   END ELSE

      PRINTER OFF

   END

   PRINT "RESULT NUMBER " : I : " IS: " : RESULTS(I)     

NEXT I

The program execution might look like this:

RESULT NUMBER 1 TO PRINTER (Y OR N)?Y

 

ENTRY # 6

RESULT NUMBER 2 TO PRINTER (Y OR N)?N

RESULT NUMBER 2 IS: 98

RESULT NUMBER 3 TO PRINTER (Y OR N)?Y

 

ENTRY # 7

RESULT NUMBER 4 TO PRINTER (Y OR N)?

See Also

Statement and Function Reference