Star Micronics NX-10 Printer User Manual


 
105
mathematical function (a sine wave) to create a design. Later in
this chapter we’ll show something more complex. The
mathematical concepts (such as sine and pi) demonstrated here
are not important; you don’t have to be a math whiz to use this
printer’s graphics.
n Combining text and graphics
It’s also possible to mix text and graphics in one line. This can
be useful for labeling charts or graphs, or even inserting fancy
graphics in text. Try adding these lines to our program:
45 PRINTUnl, "WOW' ";
115 PRINT#l,
"THiS IS GREAT! ";
Now if you run the program you should get a printout that
looks like this:
14 (1;) bJ ! ._--“-----___
“.. . . . . . . . . . ...-“’
_.... ----.-- _.,, “I_ t.,, 1 cz; I[ cr; (1; R /g,-(- !
But there is one thing to be careful of: all graphics data must
print on the same line. The graphics command is turned off at
the end of each line, even if you have specified that more
graphics codes follow. To see what we mean, change line 30 to
plot 1000 points and run the program.
30 WID=lOOO
wciw --.--
TH I s 1s ‘eEflTT--------.---
This will make the sine wave pattern long enough to go off the
page.
As you can see, your printer printed graphics up to the end of
the line, then ignored the rest of the graphics data and returned
to normal text on the next line.