Star Micronics NX-15 user manual PRINT “Hel 10!“

Models: NX-15

1 210
Download 210 pages 57.72 Kb
Page 46
Image 46
PRINT “Hel 10!“

38

easiest operations one can do, but even they may depend on what computer you have. In Microsoft BASIC, we can list all the steps in a program by entering LIST. This lists them on the CRT screen; if we want to print them on a printer, we prefix the command with an L (enter LLIST).

Th’eMicrosoft BASIC command for outputting information is PRINT. Like the LIST command, this displays the information on the CRT screen so we have to add an L (+ LPRINT) if we want to use the printer. Just put whatever you want to print be- tween quotes and after LPRINT (anything enclosed in quotes is called a character string). For example, we would use LPRINT “Hello!” to output “Hello!” to the printer. We’ll see later how to LPRINT more than just character strings.

We started with Microsoft BASIC because it is the most wide- ly used.version of BASIC. The programs in this manual are writ- ten in Microsoft BASIC so they should run on most computers. But if strange things happen when you try to run a program, check the BASIC manual that came with your computer.

Let’s consider Apple II computers for a minute. These popular computers use their own brand of BASIC. To use an Apple II, enter the following–

F’R#1

PR7#1

L1S?’

PRINT “Hel 10!“

PR#O

PR#(l

The PR#l tells the Apple to send everything to the printer, the LIST or PRINT command sends it, and the PR#O returns output to the screen.

Now that we know how to address the printer, let’s try listing a BASIC program. We will load a program into memory ready to program printer operation – just as soon as we learn a little bit about the ASCII codes.

ASCII codes and the CHR$ function

You can talk to your computer in BASIC, but your computer and your printer talk to each other in what are known as ASCII codes. In the ASCII code, each number from Oto 255 has a par- ticular meaning – 36, for example, makes the printer print a dollar sign. Some numbers cause the printer to do other things, too. For instance, sending a 7 sounds the printer’s bell.

Page 46
Image 46
Star Micronics NX-15 user manual PRINT “Hel 10!“