35

BASIC program. Generally, computers use about the same pro- cedure for printing in a program as they do to list a program.

Let’s try what we learned. Type the following:

NEW

10 LPRINT "TESTING"

RUN

Remember-we use LPRINT; you may have to use something else!

At any rate, you should have the word “TESTING” on your printer. Quite an achievement, isn’t it? Let’s get done with this simple stuff so that we can go on to something interesting.

nThe CHR$ function

We mentioned CHR$ in Chapter 3 as one way to express ASCII codes. We are going to use it a lot in communicating with this printer. This printer uses many of the ASCII code that don’t represent letters and numbers. The CHR$ function gives us an easy way to send these codes to the printer. Try this to see how the CHR$ function works:

NEW

10 LPRINT CHR$(80)

RUN

That should print a “P” for Printer. If you check the chart in Appendix B you will see that 80 is the ASCII code for “P”.

nControl codes

This printer uses many of the non-printing ASCII codes for control codes. These codes perform a function rather than print- ing a character. Let’s try an easy one right now:

NEW

10 LPRINT CHRS(7)

RUN

Page 43
Image 43
Star Micronics NB-15 user manual NEW Lprint Testing RUN