Thought I'd mention this while I'm thinking about it. I noticed what appeared to be a bug in the scripting language while looping through some slices and it just occurred to me what might have been happening.
I had a loop that went something like this:
Code: Select all
n := slice lookup(sli:1)
n2 := slice lookup(sli:2) #the slice immediately following sli:1
while(n, and, n2)do, begin
set slice extra(n, extra 1, get slice extra(n2, extra 1))
n := n2
n2 := next sibling(n2)
end
A bug eventually started happening as I added more slices to the overall collection where the loop would drop out at about the halfway point. I added some debugging "show values" and found that the looping stopped whenever the slice values stored in n and n2 were 256 and 257, respectively (I think). I fixed the error by replacing the while loop condition with "while(n <> 0, and, n2 <> 0)do, begin". I'm guessing the error has something to do with the fact that 256 is a maximum for a signed integer and maybe 257 is -256 or something like that.... okay, maybe I don't know exactly what happened, but I think the fact that the first value was 256 has something to do with it.
Anyway, I just wanted to make note of this in case it's an unknown bug. Or maybe my initial while-condition was bunk for some reason which I'd also like to know about.
Thanks for reading!