SRL Archive - Discussions and Debates

This confuses me?


Camaro'

2008-07-25 21:41:06

Lets say i wanted to do

SortTPAFrom(Walk, TP);

But i wanted to walk farthest away first.

For i := 0 to Length(Walk) - 1 do

Wouldnt work because it would search for it cloest to me. I want it the farthest away from me.

The way SortTPAFrom works is the first Tpoint in the Tpointarray is closest to the tpoint. The last Tpoint in the Tpointarray is farthest away from the tpoint provied.(TP).

How would i go about using for to do to walk farthest away using sorttpafrom. I hope you guys understand what im trying to say here.


EDIT: I know im becoming less active here. I just wanted to know cause i really never understood that. EDIT: Probbaly should of been in SRL HELP

3Garrett3

2008-07-25 21:50:01

Umm.. Isnt there:

for i:= Length(Walk) - 1 downto 0 do

?? I think so.

The Claw

2008-07-25 21:56:42

InvertTpa(Tpa name) would work

Camaro'

2008-07-25 22:32:06

Oh my bad, i had that but when i was actually testing this i had messed up my Mouse
and it resulting in a runtime. So now i got it.

Thanks sorry for wasting ur time