SRL Archive - OSR Help

How to Convert an Integer to a Point.


Cage

2015-05-27 12:50:05

Hello.

This is a very simple question, but since I am new to Pascal, I am having a hard time working it out.
I want to be able to use
 SMART_DrawDots(TPoint);
to model this mouse movement algorithm.

procedure CustomMouseMove(X, Y: Integer);
var
RandomNumber: Integer;
begin
RandomNumber := Random(100);
if(RandomNumber <= 80) then
MMouse(X, Y, 28, 28) else
begin
MMouse(X, Y, 40, 40);
Writeln('Going Large');
end;
end;

How do I go about converting a simple X,Y coordinate to a point so I can insert it into the function? Thanks!

Ian

2015-05-27 13:03:04


IntToPoint(x, y)

Cage

2015-05-27 13:10:26

Thanks for the response. I am getting a type mismatch error.

SMART_DrawDots(Point(X,Y));

Ian

2015-05-27 13:17:35

See my edit, point(x, y) is SRL-6. You'll have to use IntToPoint(x, y) Point(x, y) will work

Hoodz

2015-05-27 13:31:41


var
yourPoint: TPoint;

yourPoint := point(x, y);

this is a way.

Pavement

2015-05-27 15:16:32

From: Cage
Thanks for the response. I am getting a type mismatch error.

SMART_DrawDots(Point(X,Y));


Type mismatch because you have called SMART_drawdots(); and you have only put in one point. If you are only using 1 point use SMART_drawdot();

slacky

2015-05-28 16:13:30

From: BMWxi
See my edit, point(x, y) is SRL-6. You'll have to use IntToPoint(x, y)

False. `Point(x,y:Integer)` is exported from Simba.

Ian

2015-05-28 16:47:19

From: slacky
False. `Point(x,y:Integer)` is exported from Simba.


Whoops, yeah. Not sure why I thought that.