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.
帕斯卡抛出的错误是:23 / 4 mouse.pas 致命:语法错误,; 预期但是。找到但我有正确的开始和结束数量,所以因为它是最后一个需要'。
一切顺利