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

LSL Wiki : llList2String

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are
string llList2String(list src, integer index)

Returns the string at index from the list src.

llList2String(foo, 0); // returns the first element in the list
llList2String(foo, 1); // returns the second element in the list

integer len = llGetListLength( myList ); 
integer i;
for( i = 0; i < len; i++ )
llOwnerSay(llList2String(myList, i));     
//This script will read the list one element at a time

Unlike the other llList2Xxx() functions, llList2String() has some useful default behaviors:
1. If the index refers to a non-existant element, then the empty string is returned. This works if either the index >= the length, or if index < 0 - length.
2. If the item in the list at the index isn't a string, it is cast to a string.

Note that because llList2Vector and llList2Rot will not cast a string to a vector or rotation, you'll need to use llList2String and then typecast the result directly.

Compare with llList2Float, llList2Integer, llList2Key, llList2List, llList2ListStrided, llList2Rot, llList2Vector and llGetListEntryType.

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]
erm spam?
-- (2007-12-17 14:40:06)
Attach a comment to this page: