Don't click here unless you want to be banned.

LSL Wiki : llList2Vector

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl427.us.archive.org
vector llList2Vector(list src, integer index)

Copy and return the vector at index in the list src.

Compare with llList2Float, llList2Integer, llList2Key, llList2List, llList2ListStrided, llList2Rot and llList2String.

Example:
llList2Vector(foo, 0); // returns the first element in the list.
llList2Vector(foo, 1); // returns the second element in the list.

Note: llList2Vector will not automatically cast a string to a vector. Thus, if you attempt to retrieve a list element consisting of a vector cast to a string like "<1,2,4>", llList2Vector will return ZERO_VECTOR or <0,0,0>. This can be avoided by using llList2String and casting directly, as in:
vector foo = (vector)llList2String(["<1,2,4>"], 0);


This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.

Functions | Lists
Comments [Hide comments/form]
When you cast a string to a vector you apparently don't need to enter the >, as long as the function finds a < it is happy
-- RonFleming (2006-06-10 04:49:36)
Well... if you have to manually cast the output of llList2Vector() into a vector, this function is pretty much useless. Isn't it?
-- Jadz0rConover (2006-08-28 04:16:04)
No. If you know for sure you're going to be storing a vector in the list (say, reading a value from a notecard or a position), then llList2Vector works.

However, all of the llList2* functions except llList2List and llList2ListStrided are pretty much useless because you can typecast the result returned from llList2String.
-- DolusNaumova (2006-08-28 09:00:16)
They're not useless, because it's more efficient to return a vector (or whatever) than to return a string and convert the string into a vector (or whatever).
-- LearjeffInnis (2006-12-13 11:38:37)
Attach a comment to this page: