Radio Shack TRS-80 Model 100 Basic Manual page 16

Basic language lab
Hide thumbs Also See for TRS-80 Model 100:
Table of Contents

Advertisement

Enter the following program:
1121 PRINT "HOW ", "NOW ";
2121 PRINT "BROWN";
"COW"
Would you guess what the output of this program will produce? When executed, the
display will show:
Hm~
Ok
1\IOlr-J BFWWI\ICOW
The comma in line 10 caused the two strings HOW and NOW to be spaced several
columns apart. The semicolon between the two words "BROWN" and "COW"
caused them to print without a space. Now if line 10 is retyped so that the comma is
changed to a semicolon and the semicolon at the end of the statement is omitted,
1121 PRINT "HOW"; "NOW"
2121 PRINT "BROWN"; "COW"
the output would be
HOW NOW
BROWNCOW
The second PRINT statement produces output on the second line because the carriage
return after the first PRINT statement has not been suppressed with a semicolon or
comma. If you wanted to print the words on one line, neatly spaced one column apart,
you could rewrite your program as follows:
1121 PRINT "HOW"; "NDW ";
2121 PRINT "BROWN"; "CDW"
10

Advertisement

Table of Contents
loading

Table of Contents