Star Micronics Radix User Manual page 70

Table of Contents

Advertisement

56
Radix User's Manual
The CHR$ function
We mentioned CHR$ in Chapter 2 as one way to express
ASCII codes. We are going to use it a lot in communicating with
Radix. Radix uses many of the ASCII codes 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$(82)
RUN
That should print an "R" for Radix. If you check the chart in
Appendix I you will see that 82 is the ASCII code for "R".
Control codes
Radix uses many of the non-printing ASCII codes for control
codes. These codes perform a function rather than printing a
character. Let's try an easy one right now:
NEW
10 LPRINT CHR$(7)
RUN
Where did that noise come from? That's Radix's bell. We will
learn more about it in Chapter 10. We just wanted to illustrate a
code that causes Radix to perform a function.
The escape code
There's one ASCII code that we are going to be using more
than all the rest. This is ASCII 27, which is called escape. In
BASIC it is CHR$(27). With all of Radix's advanced features, there
weren't enough single ASCII codes to access all of them. So
escape is used to start sequences of control codes that open a
wider range of functions to us.
While you must call this code CHR$(27) in BASIC, we are
going to refer to it as (ESC) in this book. This will make it much
easier to recognize when we use it.
A typical escape code sequence starts with (ESC) which is
_
-

Advertisement

Table of Contents
loading

Table of Contents