Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Chat to Array and back ?

Christif Vaher
Registered User
Join date: 24 Jun 2008
Posts: 51
10-07-2008 13:16
person is a string
money is an integer
status is a string


I am looking for a way to turn chat such as this

person, money, status

or

Jake, 10, active


Into an array for use by a script that will end up looking like this:
list person_info = [person, money, status]


Where I could then say person and have the script say back money and status.

Saying Jake

Would return 10 and active

Suggestions, comments? Speed isn't the ultimate goal. Reliability and readability are :)
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
10-07-2008 13:32
not exactly sure what you're asking there. but i think this may be what you mean

list person_info = [Jake, 10, active]

and then using listfind you would do something like this

integer namepos = llListFindList(person_info,[name];
if (namepos != -1)
{
integer money = llList2Integer(person_info,namepos + 1);
string status = llList2String(person_info,namepos + 2);
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
10-07-2008 14:01
Look about 3/4 of the way down this page at using Strided Lists:

http://lslwiki.net/lslwiki/wakka.php?wakka=list
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
10-07-2008 22:58
You may also want llList2CSV() and llCSV2List().

http://www.lslwiki.net/lslwiki/wakka.php?wakka=llList2CSV
http://www.lslwiki.net/lslwiki/wakka.php?wakka=llCSV2List