' *** LINE.LST *** 2nd GFA-Manual, page 20-26 > PROCEDURE line(VAR x1,y1,x2,y2) ' ' *** Let user draw a line with the mouse and return coordinates of line ' *** Instructions for user are shown on bottom-line of TOS-screen ' ' *** Standard: x.max& y.max& char.height& line.max& col.max& ' *** Procedure: Point ' LOCAL message.scrn$,text$,x3,y3,k @point(" Click once for starting point ",x1,y1) ! line-start (x1&,y1&) GRAPHMODE 3 text$=" Draw line (confirm with click) " GET 0,y.max-char.height,x.max,y.max,message.scrn$ ! save screen under message LOCATE 1,line.max PRINT CHR$(27);"K"; ! clear bottom line PRINT SPACE$((col.max-LEN(text$))/2)+CHR$(27)+"p"+text$+CHR$(27)+"q"; PAUSE 50 DEFMOUSE 0 SHOWM x2=MOUSEX y2=MOUSEY REPEAT ! wait for mouse-movement MOUSE x3,y3,k UNTIL x2<>x3 OR y2<>y3 PUT 0,y.max-char.height,message.scrn$,3 ! restore screen MOUSE x2,y2,k ! line-end (x2&,y2&) REPEAT LINE x1,y1,x2,y2 ! draw line SHOWM REPEAT MOUSE x3,y3,k UNTIL x2<>x3 OR y2<>y3 OR k>0 LINE x1,y1,x2,y2 ! erase line x2=x3 ! new line-end y2=y3 UNTIL k>0 GRAPHMODE 1 LINE x1,y1,x2,y2 ! finished HIDEM PAUSE 10 ! give user time to release mouse-button RETURN ' ********* '