MOUSE
PROCEDURE SETMAX (XMAX,YMAX: INTEGER)
Example
Here is an example fo r th e use o f th e Mouse procedures ii
PascaL
In th e fir s t p art o f th e main program , th e maximum Mous<
position is se t b y means o f the X and Y coordinates; an<
the present Mouse position is s e t to zero. In the secon<
p art o f th e main program, th e variables are c o lle c te d an<
displayed on th e screen . SW1, SW2, and SW3 designate th<
sw itch es on th e Mouse (here th e HAWLEY MARK I I Mouse)
which can be on or o f f. X is th e Mouse position on th e )
coord in ate, Y th e Mouse position on the Y coordinate.
{ EXAMPLE MOUSE PROGRAM PASCAL }
PROGRAM MOUSETP;
USES MOUSE;
VAR SW1,SW2,SW3,X,Y,X0,Y0,XM,YM: INTEGER; C:CHAR;
PROCEDURE FIN(VAR C:CHAR);
{ PROMPT FOR FINISH }
BEGIN
GOTOXY(0,18);
WRITE(' DO YOU WANT TO FINISH? Y/N ');
READLN(C );
END;
BEGIN
{ CLEAR SCREEN, CURSOR INVISIBLE }
WRITELN(CHR(27) , 'ยง0',CHR(27) ,CHR(69));
WRITELN(' ****** MOUSE EXAMPLE PASCAL ******')
GOTOXY(0,16);
WRITELN(' TO STOP PRESS SWITCH 1 ');
8 -