Sharp MZ-700 Series Owner's Manual page 88

Personal computer
Hide thumbs Also See for MZ-700 Series:
Table of Contents

Advertisement

(Example 3) The following program draws a rectangle with aside length of 240 units.
1 0
M O D E
G R
2 0
S Q = I N T ( 1 2 0 X S Q R
( 3 ) )
3 0
L I N E
962 , 2 4 0 , 0 , 1 2 0 , - S Q , 0 ,
0
4 0
M O D E
T N
The lines indicated with n are as follows.
* # # LINE
I - 1 6
* * *
_N= 1
N--2
_N=3
N=4
_N=5
_N=6
N=7
N = 8
_N=9
_N= 1 0
N=1 1
_N= 1 2
1 3
_N= 1 4
_N= 1 5
N=16
2.7.6.2 RLINE
(abbreviated format: RL.)
RLINE
Format
Xi, yi < , x
2
, y
2
, . . . xi, y i . . . >
y
2
, . . . , xi, yi . . . >
Function
RLINE
%n, X j , y
l 3
< , x
2
,
n
Integer from 1 to 16
xi
Number indicating the X coordinate (—480 to 480)
yi
Number indicating the Y coordinate (—999 to 999)
This statement draws a line from the current pen location to the location indicated
by relative coordinates x
1 ;
y
l 5
then draws a line from that point to the location
indicated by relative coordinates x
2
, y
2
, and so on. n is the same as for the LINE
statement.
This program draws the same rectangle as example 3 above.
1 0
M O D E
G R
2 0
S Q = I N T ( 1 2 0 X S Q R
( 3 ) )
3 0
R L I N E
961
, 2 4 0 , 0 , - 1 2 0 , - S O , - 1 2 0 ,
S Q
4 0
M O D E
T N
Initial pen location
Initial pen location
240/
(240,0)
Example
(0,0)
1 2 0 / 3
Figure drawn , ' 2 4 0 , 0 } , C I 2 0 , — S Q ;
0,0
by LINE
( 1 2 0 , - 1 2 0 / 3 )
I
I
-
Figure drawn ,'240.0';
( - 1 2 0 , - S Q " ) . ' - 1 2 0 , S C f ;
by RLINE
"*
""
- - - ' '
' '

Advertisement

Table of Contents
loading

Table of Contents