Accessing an element in a List?
by Vern Jensen · in Torque Game Builder · 06/17/2006 (12:30 am) · 2 replies
When a function returns a List (such as getWorldLimit()), how do I access the item in the list I want? (For instance, the maxX element from getWorldLimit()'s returned LIst, which would be its 4th item.)
Tried looking in the documentation, but I must be looking in the wrong place...
-Vern
Tried looking in the documentation, but I must be looking in the wrong place...
-Vern
#2
I guess it'll take a little getting-used-to that numbers and strings, etc. are interchangeable in Torque... I can use a number that's inside a string as if it's a number.
-Vern
06/17/2006 (11:43 am)
Thanks -- that works great!I guess it'll take a little getting-used-to that numbers and strings, etc. are interchangeable in Torque... I can use a number that's inside a string as if it's a number.
-Vern
Torque Owner Michael Woerister
e.g.:
This prints out:
The first word has index 0. So in your case you would use getWord(%yourList, 3) to get maxX.