4/ BASIC Printer Control Codes
We’ve told you that six control codes are available. In this section we will discuss how to use these control codes. Normally, LPRINT CHR$( ) is used to send the instruction to the TP-10.
This command advances the paper one line, with the carriage staying inthe current position.
When this command is received, the Printer moves the carriage to the left margin and advances the paper one line.
When the Printer receives this code, the carriage is moved to the left, but the paper does not advance.
10 LPRINT CHR$(13);: REM TO BE SURE CARRIAGE IS AT LEFT 20 LPRINT "THIS IS IMPORTANT"; 30 LPRINT CHR$(26): REM CARRIAGE RETURN ONLY 40 LPRINT CHR$(28) CHR$(17) CHR$(95)
This program will print line 20, return the carriage to the left without advancing the paper, and then print an underline (ASCII code 95) under “THIS IS IMPORTANT”. We will explain CHR$(28) shortly.
This control code is somewhat different from the other control codes. Only when these two codes are received in succession, does the Printer enter the elongated mode. All the characters after this code sequence will be printed at twice the normal width.
This also is a two-code sequence. Upon receipt of this code sequence, the Printer exits the elongated mode and all the characters after this will be printed in normal size.
10 LPRINT “NORMAL”; 20 LPRINT CHR$(27) CHR$(14); 30 LPRINT “ELONGATED”; 40 LPRINT CHR$(27) CHR$(15); 50 LPRINT “NORMAL AGAIN”
This code tells the TP-10 to print the character repeatedly. The first figure n determines the number of repetitions (between 0 and 255: if 0 is input, printing repeats 256 times); the second figure m is the ASCII code for the character to be repeated. Note that the character need not be in code; put ” “ around the character to be printed.
LPRINT CHR$28) CHR$(10) CHR$(134)
Prints the graphics character 10 times.
LPRINT CHR$(28) CHR$(5) "T"
Prints five T’s.
Note: When codes other than those defined above are entered, TP-10 either ignores them or prints X.
Codes printed as X