program MouseInput;
Uses WinCrt,WinMouse, Graph;
Var
GraphicsDriver, GraphicsMode,
ErrCode : smallint;
x, y: shortstring;
Begin
x:=GetMouseX;
Y:=GetMouseY;
Writeln('Initialising Graphics, please wait...');
GraphicsDriver := Detect;
InitGraph(GraphicsDriver, GraphicsMode,'');
GetmouseX();
GetmouseY();
OuttextXY(0,0,x);
readln();
end.
It give me the error:
23 / 20 mouse.pas
Error: Incompatible types: got “WORD” expected “SHORTSTRING”
But i don’t know how to change it so it works becase GetmouseX needs to be Word.
Your GetMouseX and GetMouseY functions don’t return a result and where you call them doesn’t read the result, I’d have thought you’d get a stack overflow error since they call themselves (or is this a compiler error).
Having just seen paulsm’s comment (I can’t remember the Turbo Pascal functions) I think your code should be like this:
From Your link: