LLIST it (or however your computer does it). We’ve crossed the
first major hurdle-learning how to list programs on SC-10/l%
Now we are ready to jump into the world of programming with
SG-10/15. But first, there are a few fundamentals that we need
to cover.
W Establishing communications
We’ve learned something about communicating with our
printer. Now we need to adapt what we know to printing in a
BASIC program. Generally, computers use about the same
procedure 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.
n The 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
SG- lo/ 15. SG-lo/15 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$(83)
RUN
That should print an “S” for Star. If you check the chart in
Appendix B you will see that 83 is the ASCII code for “S”.
31