SRL Archive - OSR Help

Getting mouse position?


Chen Monopoly

2012-05-27 22:51:42

How would I get the actual X and Y position?
I've tried the GetMousePos or something but that's a procedure and doesn't really return anything.

Main

2012-05-27 23:03:24


Procedure TestMouse;
Var
M: TPoint;
Begin
GetMousePos( M.X, M.Y);
Writeln( 'Our position is ' + IntToStr( M.X) + ' and ' + IntToStr( M.Y));
End;

Chen Monopoly

2012-05-27 23:27:02

Okay thanks.

Sin

2012-05-29 09:54:39

What Main said is fine and dandy, but if you want it to be a little less complicated when using the vars, do this -


procedure NIFNISDFDFIKS;
var
x,y:Integer;
begin
GetMousePos(x,y);
Writeln( 'Our position is ' + IntToStr( M.X) + ' and ' + IntToStr( M.Y));
end;

putonajonny

2012-05-29 10:40:03

From: Shay
What Main said is fine and dandy, but if you want it to be a little less complicated when using the vars, do this -


procedure NIFNISDFDFIKS;
var
x,y:Integer;
begin
GetMousePos(x,y);
Writeln( 'Our position is ' + IntToStr(M.X) + ' and ' + IntToStr(M.Y));
end;


He means this…

procedure NIFNISDFDFIKS;
var
x,y:Integer;
begin
GetMousePos(x,y);
Writeln( 'Our position is ' + IntToStr(X) + ' and ' + IntToStr(Y));
end;