M-SCRIPT has the ability to do a number of print modifications as part of its own program. Headers, indents, double spacing, and dozens of other functions are possible with the appropriate commands. There are times, however, when you may want to use your printer’s special abilities. M-SCRIPT provides a method to allow you to send your printer its own special codes.
The Printer
The bottom line is that you want to tell your printer to perform one of its special functions. The first place to start is your Printer’s manual. It will have descriptions of each of its features, and, at the back, a summary of its commands. An example of some commands, as listed in the summary, would be:
Star-Gemini 10X
Control Hexi- Code Decimal decimal Function ESC-1 45 1 2D 01 Underline ESC-0 45 0 2D 00 Cancels underline ESC 4 52 34 Selects Italics ESC 5 53 35 Cancels Italics
What signal needs to be sent to engage each of these functions is not immediately obvious. With some deduction, however, we can untangle the summary.
Hexi- Decimal decimal LPRINT Function 27 45 1 1B 2D 01 CHR$ 27+"-"+CHR$ 1 underline 27 45 0 1B 2D 00 CHR$ 27+"-"+CHR$ 0 Cancels underline 27 52 1B 34 CHR$ 27+"4" Selects Italics 27 53 1B 35 CHR$ 27+"5" Cancels Italics
After you understand what the printer expects with each command (the syntax), you are ready for the next step.
On to M-SCRIPT
Look at the last table, in the LPRINT column. Characters that appear within quotes in this column can be sent directly to the printer by M-SCRIPT. Characters described by CHR$ ?? are called unprintable characters, or control codes. They can also be sent, but they must be handled differently.
There are three steps to sending unprintable characters.
Step one: establish what unprintable characters you will need. In this case, we need CHR$27, CHR$ 1, and CHR$ 0. M-SCRIPT can hold ten different unprintable characters. In the text, they are called forth by Function-G (©), followed by a number from 0 to 9. Each ©-number combination will generate a unique unprintable character, as defined by you in…..
Step two: insert a control line in your text file as the first line. This line will hold the values of the unprintable characters you are using. An example, using the three values above, would be:
>#7=27/0,#1=1/0,#0=0/0\
>#7=27/0,#1=1/0,#0=0/0\
character reference number code (in decimal) to be sent to printer number of spaces on the printed line the code will occupy
Step three: invoke the control codes as you need them. To underline what comes next, press Function-G, then the needed number. Since underline needs CHR$ 27, a hyphen, and CHR$ 1, we would use ©7-©1this will be underlined ©7-©1. Note that there are no spaces between the characters.
What if I need more than 10 different codes?
No problem–just insert a second definition line as needed.
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.