home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 20
/
AACD20.BIN
/
AACD
/
Graphics
/
PerfectPaint
/
rexx
/
ellipse
/
Total_Ellipse.rx
< prev
Wrap
Text File
|
1999-12-09
|
1KB
|
82 lines
/* Script Rexx
Ellipse with a number of points*/
call addlib("rexxmathlib.library", 5, -30, 0)
options results
parse ARG Port x1 y1 r r2 b
ADDRESS COMMAND
s0=20
sens=0
if EXISTS('PerfectPaint:Prefs/Rexx_Prefs/Total_Ellipse') THEN DO
IF OPEN('lfile','PerfectPaint:Prefs/Rexx_Prefs/Total_Ellipse', "R") then DO
s0 = READLN('lfile')
sens = READLN('lfile')
CALL CLOSE('lfile')
END
END
Pi=3.1415926/180
ADDRESS value Port
pp_DialogInit 250 85 "*Ellipse*" 2
pp_Integer 0 110 5 50 16 "Number*of*Point*" 1 s0
pp_Cycle 1 110 25 110 16 "Color*Option" 1 "Current*Color|Cycling*Color" sens
pp_Dialog
rc=result
if rc=0 then
do
EXIT
end
pp_GetDialog 0
s0=result
pp_GetDialog 1
sens=result
a=360/s0
pp_GetApen
z=result
pp_UpdateUndo
CALL SavePrefs('Total_Ellipse',s0,sens)
ADDRESS value Port
DO i=0 To 359 by a
x = Sin(i*Pi)*r+x1
y = Cos(i*Pi)*r2+y1
pp_Plot x y
if sens=1 then DO
pp_SetApen z
z=z+1
END
END
EXIT
SavePrefs: PROCEDURE
Prefname='PerfectPaint:Prefs/Rexx_Prefs/'||ARG(1)
if EXISTS(Prefname) THEN DO
ADDRESS COMMAND
'delete >nil: '||Prefname
END
IF OPEN('pfile',PrefName,'W') THEN DO
do i=2 to ARG()
CALL WRITELN('pfile',ARG(i))
end
CALL CLOSE('pfile')
RETURN