PRINT list

The PRINT command sends information to the specified output device. LIST can be:

STRING CONSTANT : i.e., PRINT "HELLO" VARIABLE : i.e., PRINT A PCG CHAR : i.e., PCG:PRINT "A" i.e., PRINT "HELLO",;A The character suppresses the combination. The , character causes the cursor to advance ZONE spaces. The PRINT output can be formatted or unformatted. To format the output, use the following subcommands. INTEGER FORMAT [Iint int-exp] int-exp is placed in a field int characters wide. If int-exp is too large to fit within the field, * symbols will be printed.

Program Example.

00100 A = 10 
00110 B = 123 
00120 C = 15673 
00130 PRINT [I5 A] : PRINT [15 B] : PRINT [15 C] 
00140 END

Try it

REAL FORMAT [Fnl.n2 real-exp]

real-exp is placed in a field n1 characters wide, with a decimal point n2 digits from the right of the field. The field width must be TWO characters greater than the number of digits printed. If the number is too large for the field, * signs will be printed.

Program Example.

00100 AO = 10.987 
00110 B0 = 123.9 
00120 CO = 15673.987 
00130 PRINT [F10.2 A0] : PRINT [F10.2 B0] : PRINT [F10.2 CO]

Try it

EXPONENTIAL FORMAT. [Dn real-exp]

Real-exp is printed out in exponential format in a field n+7 wide, with n digits after the decimal point.

Program Example.

00100 A0 = 10.987 
00110 BO = 123.9 
00120 CO = 15673.987 
00130 PRINT [D3 A0] : PRINT [D3 BO] : PRINT [D3 CO] 

Try it

ASCII FORMAT [An int -exp]

The value of the INTEGER expression is output as its equivalent ASCII character n times. The mapping between the decimal representation of a character and the character itself is presented in the appendices.

Program Example.

00100 REM The ASCII Format command. 
00110 PRINT [A50 85] 
00120 END 

Try it

The Newline Character.

If the \ character is used within a PRINT statement, it will specify a new line.

00100 REM The \ character 
00110 PRINT "Hello";\;"How are you" 
00120 END

Try it

See also LIST, LLIST, LPRINT, INPUT.