SECTION
PROGRAMMNG IN BASIC
WHAT THIS SECTION SHOWS YOU:
*How to Use the Character String to Capture BASIC Commands
Gome Examples of Short Programs Utilizing Fea- tures of the printer
If you’re like most personal computer owners, you’ll probably use your printer primarily for printing your spreadsheet and word pro- cessing applications. But if you are interested in some of the more esoteric uses of your
nA WORD ABOUT MBASIC
The most common form of BASIC available today is Microsoft BASIC, or MBASIC. We’ve endeavored to provide you with a few programs that will run on most computers, and for this reason the programs listed here use the most elementary form of BASIC: MBASIC for
The character string (CHR$): If you’re familiar with BASIC, you’ll know that the character string command, CHR$, is used to “capture” escape and control codes such as those which control the printer. BASIC doesn’t understand an escape code or control code all by itself; but you can enter escape or control codes within the character string format. To do this, enter the decimal form of the code between the parentheses in CHR$( ). Here are a few examples of the printer’s features that can be programmed in BASIC:
Expanded type: The expanded type feature enlarges each of the pitch sizes to twice their normal widths. Try this program to see how it works: