51
W
Suppose you need to move to a position across the page, but you only need to do it once. It doesn’t make much sense to set up a tab to use only one time. There is an easier way.
The solution is called a
Table | ||
Function | Control code | |
(ESC) “f” 0 CHR$(n) | ||
spaces | ||
| ||
Absolute horizontal tab | (ESC) “$” CHR$(nl) CHR$(nZ) | |
Relative horizontal tab | (ESC) ‘I\” CHR$(nl) CHR$(n2) |
The first command in Table
The absolute horizontal tab command moves the print head to a specified position on the page. The position that you want the print head to move to (measured from the left margin) is specified by the values of nl and n2 using the formula nl + n2
x 256.
Try this program to see how this works.
10 ’ Demo of absolute horizontal tabs
20FOR I=60 TO 70 STEP 2
30LPRINT I
40LPRINT CHR$(~~) ;“$“;CHR$(I) ;CHR$(O) ;
50LPRINT “Horizontal tab. ”
60NEXT I
70 END
In this program, the print head is positioned before the “H” in “Horizontal” is printed.