SRL Archive - OSR Help

how to


radiclerobby

2010-04-23 20:42:38

how to use a set of info like so

TPA[0].x := 59
TPA[0].y := 162
TPA[1].x := 59
TPA[1].y := 163
TPA[2].x := 59
TPA[2].y := 164
TPA[3].x := 59
TPA[3].y := 165

put it in a way so i can call it later for use like this

for i:= 0 to high(tpa) do
begin
if(getcolor(tpa[i].x,tpa[i].y)=23121)then
begin
writeln('foundcolor');
exit;
end;
end;
something along those lines. thanks in advanced

Awkwardsaw

2010-04-23 21:07:39

what exactly is the info you need to store?

radiclerobby

2010-04-23 21:10:48

just points like x,y but i want to have a array of info that i set like

MyTpa [0]:= inttopoint(1, 1);
MyTpa [1]:= inttopoint(10, 10);
like that but more points of course


EDIT: never mind i found out

Awkwardsaw

2010-04-23 21:14:59


var
tpa : TPointArray;
i : integer;
begin
tpa := [point(59, 162), point(59, 163), point(59, 164), point(59, 165)]
for i:= 0 to high(tpa) do
begin
if(getcolor(tpa[i].x,tpa[i].y)=23121)then
begin
writeln('foundcolor');
exit;
end;
end;
end;

like so? :)