/* Script Rexx Circle with a number of point*/ call addlib("rexxmathlib.library", 5, -30, 0) options results parse ARG Port x1 y1 r b ADDRESS COMMAND s0=20 sens=0 if EXISTS('PerfectPaint:Prefs/Rexx_Prefs/Total_Circle') THEN DO IF OPEN('lfile','PerfectPaint:Prefs/Rexx_Prefs/Total_Circle', "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 "*Circle*" 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_Circle',s0,sens) ADDRESS value Port DO i=0 To 359 by a x = Sin(i*Pi)*r+x1 y = Cos(i*Pi)*r+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