More Print Control Commands
Chapter 3
More Print Control Commands
That last chapter was a heavy one, but it gave us a good overview of many
As before, CHR$ is the magic wand. Continue to refer to Appendix B as needed to help maintain perspective on what we’re doing and where we’re going.
Double the PleasureThere is an easy way to print 2 sizes of characters on the same line. We simply switch back and forth between single and double WIDTH. The result is quite impressive.
Type in this simple program:
9 PR #1
10 PRINT TAB(10) ;
20 PRINT CHRS(14) "DOUBLE
30 PRINT "ADD" CHRS(14)"
39 PR #0
(Apple only. Apple disk uses:) (9 PRINT CHR$ (4) “PR# 1”)
(TRS type uses LPRINT)
"CHR$(20)" WIDTH CHARACTERS";
EMPHASIS!"
(Apple only. Apple disk uses:) (39 PRINT CHR$ (4) “PRO”“)
and RUN.
Figure
Note carefully where the spaces are positioned in lines 20 and 30. Now study the spaces in the printout.
When a space is placed after an ASCII 14, (double width, or CANCEL single width), that space is printed as 2 spaces. If placed after ASCII 20 (single width), it takes up only a single space.
23