Star Micronics SG-10 User Manual page 120

Star micronics printer user's manual
Table of Contents

Advertisement

270 '
280 'Subrout
290 '
:ine to draw a line from Xl,Yl
tt
0
X2,Y2.
300 XL = X2 - Xl
: YL = Y2 - Yl
310 NX = ABS(XL*LXFAC) : NY = ABS(YL*LYFAC)
320 IF NX < NY THEN NX = NY
330 NS% = INT(NX+l)
340 DX = XL/NS%
: DY = YL/NS%
350 FOR 1% = 1 TO NS%
360 Xl = Xl + DX
:Yl=Y
+ DY
370 GOSUB 400
380 NEXT 1%
390 RETURN
408 '
410 'Subroutine to plot a point at Xl,Yl.
42Q '
430 XX = Xl * LXFAC
: YY = Yl ;k LYFAC
440 COL% = INT(XX) + 1
450 ROW% = INT(YY/6)
460 XIT% = INT(YY - ROW% ik 6) + 1
470 BIT%(COL%,ROW%) = BIT%(COL%,ROW%) OR MASK%(XIT%)
480 RETURN
600 '
61Q ' Subroutine to plot a circle.
624) '
630 RAD = 9
640 xl = 19
: Yl = 10
650 FOR ANG% = 0 TO 360 STEP 10
660 RANG = ANG%"6.28/360
670 X2 = RAD"COS(RANG)+lQ :
y2
= Rm"S
680 GOSUB 270
690 NEXT ANG%
700 RETURN
IN(RANG)+10
If you are using with the IBM mode, change the following lines
to the program given above.
160 LPRINT CHR$(27) "A" CHR$(6) CHR$(27) "2"
250 LPRINT CHR$(27) "A" CHR$(l2) CHR$(27) "2"
n How the program works
In the program
above, we've created an array called BIT%,
which is dimensioned
in line 50. You'll note that instead of using
numeric constants to dimension the array, we used the variables
MAXCOL%
and MAXROW%.
This way, if your computer
has enough memory and you want to plot a larger image, all
112

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sg-15

Table of Contents