program MouseInput;
Uses WinCrt,WinMouse, Graph;
Var GraphicsDriver, GraphicsMode :smallint;
x, y: smallint;
function GetMouseX: word;
function GetMouseY: word;
procedure InitMouse;
procedure DoneMouse;
Begin
Writeln('Initialising Graphics, please wait...');
GraphicsDriver := Detect;
InitGraph(GraphicsDriver, GraphicsMode,'');
begin
InitMouse;
Writeln('Move mouse cursor to square 10,10 to end');
Repeat
X:=GetMouseX;
Y:=GetMouseY;
Writeln('X,Y= (',X,',',Y,')');
Until (X=9) and (Y=9);
DoneMouse;
end;
end.
The error pascal is throwing out is:
23 / 4 mouse.pas
Fatal: Syntax error, ; expected but . found
But i have got the correct number of begins and ends so becuase it is the last one it needs a ‘.’
All the best
Arran
You’re missing the main program block, and then of course same for some of your functions procedures. The below will compile as it supplies the missing blocks, but of course it will do nothing.