**TI92P*mainšå×6Xå6&7S·!ԟO3×6šåšå×6ā påV%7ž›RrulerŲ „Z ~() Prgm ©On-screen ruler & protractor ©15jul02/dburkett@infinet.com ©Calls util\copyto_h() local gdb,key,draw_all,mode,help,move_x,move_y,modedb,p,q01,q02,r,ko,km,kh,khm,dist Define draw_all()=Prgm PxlHorz main\µoy PxlVert main\µox PxlHorz main\µty PxlVert main\µtx PxlCrcl main\µoy,main\µox,2 EndPrgm Define help()=Prgm Dialog Title "Ruler Help" Text "[O] Set origin" Text "[M] Measure" Text "[STO] Copy measurement to Home" Text "[H] Help" Text "To quit:" Text "[HOME], [ESC] or [QUIT]" EndDlog EndPrgm Define move_x(m,i)=Prgm If m=1 then PxlVert main\µtx,0 mod(main\µtx+i,main\µx)main\µtx Else PxlVert main\µox,0 PxlCrcl main\µoy,main\µox,2,0 mod(main\µox+i,main\µx)main\µox Endif EndPrgm Define move_y(m,i)=Prgm If m=1 then PxlHorz main\µty,0 mod(main\µty+i,main\µy)main\µty Else PxlHorz main\µoy,0 PxlCrcl main\µoy,main\µox,2,0 mod(main\µoy+i,main\µy)main\µoy Endif EndPrgm Define dist()=Func local dd,dr,xd,yd (main\µtx-main\µox)*µsclxd (main\µoy-main\µty)*µsclyd If xd=0 and yd=0 Then undefdr:drdd else RPˆ(xd,yd)dr dr*180/Œdd EndIf return {xd,yd,dr,dd} EndFunc StoGDB gdb GetMode("ALL")modedb setMode("3","1") ClrDraw ClrGraph PlotsOff FnOff SetGraph("3","1") SetGraph("4","1") DispG if getconfg()[dim(getconfg())-14]=240 then 239main\µx 103main\µy 111ko 109km 104kh 8273khm .013772main\µscl else 159main\µx 77main\µy 45ko 53km 56kh 277khm .01381main\µscl endif 10main\µox main\µy-10main\µoy intdiv(main\µx,2)main\µtx intdiv(main\µy,2)main\µty 1mode draw_all() help() Loop GetKey()key If key=264 or key=khm or key=4360:Exit ©Handle arrow keys ©[RIGHT] If key=340 Then move_x(mode,1) draw_all() ©[LEFT] ElseIf key=337 Then move_x(mode,­1) draw_all() ©[UP] ElseIf key=338 Then move_y(mode,­1) draw_all() ©[DOWN] ElseIf key=344 Then move_y(mode,1) draw_all() © Handle [2nd] arrow keys ©[2nd][RIGHT] ElseIf key=4436 Then move_x(mode,10) draw_all() ©[2nd][LEFT] ElseIf key=4433 Then move_x(mode,­10) draw_all() ©[2nd][UP] ElseIf key=4434 Then move_y(mode,­10) draw_all() ©[2nd][DOWN] ElseIf key=4440 Then move_y(mode,10) draw_all() ©Nandle [O] key ElseIf key=ko Then when(mode=0,1,0)mode ©Nandle [H] key ElseIf key=kh Then help() ©Handle [M] key ElseIf key=km Then dist()p if p[3]=undef then "undef"r else format(p[3],"F3")&" rad ("&format(p[4],"F1")&"°)"r EndIf Dialog Title "Measurement" text "x: "&format(p[1],"F2")&" in ("&format(25.4*p[1],"F1")&" mm)" text "y: "&format(p[2],"F2")&" in ("&format(25.4*p[2],"F1")&" mm)" text "ˆ: "&r EndDlog ©Handle [STO] key elseif key=258 then "{x_in,y_in,ˆrad,ˆ°}"q01 dist()q02 util\copyto_h("q01","q02") draw_all() EndIf EndLoop delvar main\µox,main\µoy,main\µtx,main\µty,main\µx,main\µy,main\µscl rclGDB gdb setMode(modedb) DispHome EndPrgmäåÜį£