It's a script to load up a configuration from a notecard, and the settings that are stored as strings (EMAIL, ACCESS, STAMPS) work fine - the strings hold their values and are usable later in the script. But when I attempt to populate 3 lists using llCSV2List (and I've tried LlParseString2List too with similar lack of success,) the lists don't seem to hold their contents. I can return any particular entry (or indeed the whole list,) immediately after the llCSV2List, but by the time it gets to state_exit(), the lists are unaccountably empty again.
Weird huh? Or am I being dim again? (I certainly can't rule that out!
)TIA for any clues!
"settings" NOTECARD CONTAINING LINES:
email = none
access = public
timestamp = on
init_messages = "This is a test!,This is a second test!,third test message,Test No.4!"
init_names = "Joe Bloggs,psimagus Hax,John Doe,George Bush"
init_timestamps = "2008-05-18 @ 13:16:50,2008-05-22 @ 11:34:11,2008-05-27 @ 18:26:30,2008-05-28 @ 19:15:21"
SCRIPT:
integer totalnumber;
string avname;
string currentname;
string message;
list messageList; // list containing messages, each definable by 'position'
list avList; // which should match the 'position' of each name in this list
list timestamps; // and timestamps since they're incremented in the same code block
string CONFIG_CARD = "settings";
string EMAIL = "none";
string ACCESS = "public";
string STAMPS = "off";
integer NotecardLine;
key QueryID;
default
{
state_entry()
{
llOwnerSay("Initializing..."
;if (llGetInventoryType(CONFIG_CARD) == INVENTORY_NOTECARD)
{
NotecardLine = 0;
QueryID = llGetNotecardLine( CONFIG_CARD, NotecardLine );
}
else
{
llOwnerSay("Configuration notecard missing, using defaults."
;state Running;
}
}
dataserver( key queryid, string data )
{
list temp;
string name;
string value;
if ( queryid == QueryID )
{
if ( data != EOF )
{
if ( llGetSubString(data, 0, 0) != "#" && llStringTrim(data, STRING_TRIM) != "" )
{
temp = llParseString2List(data, ["="], []);
name = llStringTrim(llToLower(llList2String(temp, 0)), STRING_TRIM);
value = llStringTrim(llList2String(temp, 1), STRING_TRIM);
if ( name == "email" )
{
EMAIL = (string)value;
}
else if ( name == "access" )
{
ACCESS = (string)value;
}
else if ( name == "timestamp" )
{
STAMPS = (string)value;
}
else if ( name == "initmessages" )
{
list messageList = llCSV2List(value);
integer totalnumber = (llGetListLength(messageList));
llOwnerSay("Default message queue loaded - " + (string)totalnumber + " messages."
;llSay(0, llList2String(messageList,0)); //
llSay(0, llList2String(messageList,1)); // TEST TO ENSURE CSV2List WORKING
llSay(0, llList2String(messageList,2)); //
llSay(0, llList2String(messageList,3)); // THESE ALL WORK FINE HERE
}
else if ( name == "initnames" )
{
list avList = llCSV2List(value);
llSay(0, llList2String(avList,0)); //
llSay(0, llList2String(avList,1)); // TEST TO ENSURE CSV2List WORKING
llSay(0, llList2String(avList,2)); //
llSay(0, llList2String(avList,3)); // THESE ALL WORK FINE HERE
}
else if ( name == "inittimestamps" )
{
list timestamps = llCSV2List(value);
llSay(0, llList2String(timestamps,0)); //
llSay(0, llList2String(timestamps,1)); // TEST TO ENSURE CSV2List WORKING
llSay(0, llList2String(timestamps,2)); //
llSay(0, llList2String(timestamps,3)); // THESE ALL WORK FINE HERE
}
}
NotecardLine++;
QueryID = llGetNotecardLine( CONFIG_CARD, NotecardLine );
}
else
{
state Running;
}
}
}
state_exit()
{
llOwnerSay("Email set to: " + (string)EMAIL); //
llOwnerSay("Access set to: " + (string)ACCESS); // THESE WORK FINE
llOwnerSay("Timestamps " + (string)STAMPS); //
llOwnerSay("Initialization Complete!"
;llOwnerSay (llList2String(messageList,1) + " - (" + llList2String(avList,1) + ", " + llList2String(timestamps,1) + "
"
; // TEST TO CHECK MATCHING A RANDOM MATCHING RECORD FROM EACH LIST - THIS DOESN'T WORK 
llSay(0, llList2String(messageList,0)); //
llSay(0, llList2String(avList,1)); // NEITHER DO THESE - THE LISTS ARE EMPTY

llSay(0, llList2String(timestamps,2)); //
}
}
)