Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Loading List Variables while in For Loop?

Chase Bravo
Junior Member
Join date: 18 Jun 2004
Posts: 13
06-21-2004 18:57
Hello all, I have this for loop:

for(i = 0; i < total_number ; i++)
{
intList = intList + 1;
llSay(0, (string)intList + " [" + llDetectedName(i) + "]" + " - located at coordinates: " + (string)llDetectedPos(i));

}

I have a list variable declared as lstTargets, basically I want to load the llDetectedKey(i) into lstTargets. But I seem to be having trouble loading values into the list.

Basically each time it runs through the FOR loop I want it to append llDetectedKey(i) into the list variable.

Anyone know how?
Tinker LaFollette
Dilettante
Join date: 6 Jan 2004
Posts: 86
06-21-2004 19:06
CODE
lstTargets = lstTargets + [ llDetectedKey(i) ];

...should do the trick.

More info here.
Chase Bravo
Junior Member
Join date: 18 Jun 2004
Posts: 13
06-21-2004 19:27
wOO tks Tinker!
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
06-21-2004 23:13
CODE

lstTargets += llDetectedKey(i);


should also work
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey