// Configuration Notecard Information
string PLAYLIST = "Playlist";
string CONFIG = "Config";
integer DEBUG = 1;
integer gConfigLineNbr = 0;
key gConfigKey = "";
list gUserList = [];
list gLimitedUserList = [];
string gConfigBlock = "";
Initialize() {
gConfigKey = llGetNotecardLine(CONFIG, gConfigLineNbr);
}
default {
state_entry() {
Initialize();
}
dataserver(key queryid, string data) {
if (gConfigKey == queryid) {
if (data != EOF) {
if (llGetSubString(data, 0, 0) == "["
{gConfigBlock = data;
} else if (gConfigBlock = "[USERS]"
{gUserList += data;
} else if (gConfigBlock = "[LIMITED USERS]"
{gLimitedUserList += data;
}
if (DEBUG) {
llSay(0,"data"
;llSay(0,data);
llSay(0,"gConfigBlock"
;llSay(0,gConfigBlock);
llSay(0,"gUserList"
;llSay(0,llList2CSV(gUserList));
llSay(0,"gLimitedUserList"
; llSay(0,llList2CSV(gLimitedUserList));
}
gConfigLineNbr++;
gConfigKey = llGetNotecardLine(CONFIG, gConfigLineNbr);
}
}
}
}
And the following data files...
===Start of file===
[USERS]
Bob
Ted
[LIMITED USERS]
Carol
===End of file===
With the debug statements, I get the following output:
[15:45] Object: data
[15:45] Object: [USERS]
[15:45] Object: gConfigBlock
[15:45] Object: [USERS]
[15:45] Object: gUserList
[15:45] Object:
[15:45] Object: gLimitedUserList
[15:45] Object:
[15:45] Object: data
[15:45] Object: Bob
[15:45] Object: gConfigBlock
[15:45] Object: [USERS]
[15:45] Object: gUserList
[15:45] Object: Bob
[15:45] Object: gLimitedUserList
[15:45] Object:
[15:45] Object: data
[15:45] Object: Ted
[15:45] Object: gConfigBlock
[15:45] Object: [USERS]
[15:45] Object: gUserList
[15:45] Object: Bob, Ted
[15:45] Object: gLimitedUserList
[15:45] Object:
[15:45] Object: data
[15:45] Object: [LIMITED USERS]
[15:45] Object: gConfigBlock
[15:45] Object: [LIMITED USERS]
[15:45] Object: gUserList
[15:45] Object: Bob, Ted
[15:45] Object: gLimitedUserList
[15:45] Object:
[15:45] Object: data
[15:45] Object: Carol
[15:45] Object: gConfigBlock
[15:45] Object: [USERS]
[15:45] Object: gUserList
[15:45] Object: Bob, Ted, Carol
[15:45] Object: gLimitedUserList
[15:45] Object:
For some reason, my variable gConfigBlock is being reset to [USERS] it appears, and all names appear in that list. I'm totally confused as to why this is happening!
HELP!
Thanks
