SRL Archive - OSR Help

Correct Syntax


halgboy_tbc

2012-05-04 16:32:21

I have a procedure that returns coords of a specific location… when those coords are returned I want to trigger different actions depending on which X,Y is returned, I do not know how to write this properly.

The below is written incorrect and returns the error "Closing parenthesis expected" but hopefully someone can understand what I am trying to do.

if FindNear(X, Y) then
begin
if (X=242..260) and (Y=526..574) then begin
writeln('Middle');
end;

So, just to be clear, with the above with the ".."s I was trying to detect if X and Y were found in that range.

Thanks.

footballjds

2012-05-04 16:37:06

From: halgboy_tbc
I have a procedure that returns coords of a specific location… when those coords are returned I want to trigger different actions depending on which X,Y is returned, I do not know how to write this properly.

The below is written incorrect and returns the error "Closing parenthesis expected" but hopefully someone can understand what I am trying to do.

if FindNear(X, Y) then
begin
if (X=242..260) and (Y=526..574) then begin
writeln('Middle');
end;

So, just to be clear, with the above with the ".."s I was trying to detect if X and Y were found in that range.

Thanks.


what is your find near function?
where did you learn pascal script? you can't do x = 242..260

Rich

2012-05-04 16:38:20

if FindNear(X, Y) then
begin
if (InRange(X, 242, 260) and InRange(Y, 526, 574)) then
begin
//DoStuff
end;
end;

halgboy_tbc

2012-05-04 17:27:37

Thanks Rich and footballjds.