LineSpacing
and Forms Control
Table 8-3
Line feed commands
77
Function
ASCII code
Return print head to left margin
(CR)
Advance DaDer one line
(LF)
Control code
CHRW3)
CHR$I101
1 Reverse paper one line
1 (ESC)CHR$(lO)
1
Changing Line Spacing
When you turn Radix on the line spacing is set to 6 lines per
inch (or 8 lines per inch if DIP switch A-5 is off). This is fine for
most printing applications, but sometimes you may want some
thing different. Radix makes it easy to set the line spacing to what-
ever value you want.
Try this program to see how easy it is to change the line spac-
ing:
18 'Demo variable line spacing.
28 OPEN "LPTl:" AS #l : WIDTH #1,255
30
FOR I = 1 TO 25
40 'Set line spacing.
50 PRINT #l,CHR$(27) "A" CHR$(I) j
60 LPRINT %ADIX line spacing set
70 NEXT I
to u I
80 LPRINT "Line spacing is set to
90 'Set line spacing to l/6 inch (
100 LPRINT CHR$(27) "2" ;
110 CLOSE #l
l/6 inch (normal)."
normal).
The printout is shown on the next page.
In this program, notice that we're sending codes to the printer
a different way. In addition to the LPRINT statements for charac-
ter strings, we've opened the printer as a random file in line 20.
This method, which works with most versions of Microsoft
BASIC, allows us to send codes that would otherwise be "problem
codes" (such as CHR$(lS), which BASIC automatically follows
with a CHR$(lO)). The codes are sent with the PRINT #1 state-
ment in line 50. Unfortunately, this method doesn't work for all
computers, but the appendix for your computer shows some
other ways to send "problem codes."