This is an intriguing puzzle. Can you help us figure out the underlying likely cause for the difference in behavior of the script below (it's only a few lines)?
The implications are deep for applications using lists (which is a basic data structure).
How to reproduce?:
1. Put the mysterious script below in a prim
2. Touch the prim to populate the list l
3. and Restart region under two different conditions
condition 1: size = 10 //size of list
condition 2: size = 10000 //size of list
4. Note time of region restarted.
Observation:
The set text in state_entry shows the time the script started.
With a size of 10000, the time displayed is that of the current region restart (that is the script got reset),
but with a size of 10, time of region restart doesn't change (that is the script was not reset) even if the region was restarted.
In short, the script resets depending on the size of the list. This is a critical issue for data driven applications that run on Kitely. We are trying to hard to push the envelope a little bit further. I know there are many talented scripters on this forum, your help and insights will be deeply appreciated.
Intriguing script follows
Code: Select all
list l = [];
default
{
state_entry()
{
llSetText("Started at " + llGetSubString(llGetTimestamp(), 11, 18), <1, 0, 0>, 1);
}
touch_start(integer n) {
integer size = 10000; //10000 resets script, 10 does not
integer i;
for (i = 0; i < size; i++) {
l += [ "sdjkahfgfdaskjghfadsgkhj", "kljhsfdahkjldfshlkjhfdslhlfdsh", 234987432 ];
}
llOwnerSay("done");
}
}
Ramesh