Since using the latest version of PanX, 10.2.0 b24, sometimes I happen to get, when logged on the Terminal, messages like that for many lines, generally before crashing.
You can ignore those messages, they are debugging messages that I should have removed.
As for crashing, I actually wanted to ask you about that. In the last 5 days your system has reported 5 crashes in the arrayrange( function. In spite of having this clue, I haven’t been able to reproduce the problem, and there are no crash reports from anyone else involving the arrayrange( function. I can’t tell for sure, but it looks like you might have been using the Formula Workshop when the crash occurred. Does any of this sound familiar? Do you have any details you could share with me about how you were using the arrayrange( function? (Note: You might not have realized you were using this function – the arrayrange( function is used inside other custom functions – but if you remember what formula you were using it could be helpful.)
It took me some time to find out that the crashes were connected to an arrayrange(, somewhere in a procedure, due to a special case that was never encountered before (I think).
I was ready to send a request for help opening a new Topic, but I was not able to write a minimal example, and as I found a solution for my case I forgot about it. Following your answer I went back to it and produced the following minimal example.
The goal is to check that there is an opening { and a closing } in the correct order in a phrase like ll1 (and not only one } or one {); Generating an error if one of them is missing, and indicating roughly the position.
local ll1,ll211,posO,posF,errorNear
zlog “/-/”+"----------------"+cr()+“Entering procedure”+cr()+"----------------"
ll1=“w1 w2 w3 w4 w5 w6 w7 w8 w9 {w10 w11”
ll211=arraystrip(replace(replace(ll1,"{"," { “,”}"," } “),” “,”•"),"•")
posO=arraysearch(ll211,"{",1,"•") // position of opening {
posF=arraysearch(ll211,"}",1,"•") // position of closing }
errorNear=""
zlog “/-/”+“posO:”+posO+" “+“posF:”+posF+” “+“arraysize:”+arraysize(ll211,”•")
If (posO = 0) OR (posF= 0) OR (posF < posO) // there is an error
zlog “/-/”+“ll211 entered as: “+cr()+“ll211=”+”|”+ll211+"|"+cr()+“with limits:”+" “+“posO-1:”+(posO-1)+” “+“posF+2:”+(posF+2)
// errorNear=arrayrange(ll211,posO-1,posF+2,”•") // Form I
// errorNear=arrayrange(ll211,9,2,"•") // Form II
errorNear=arrayrange(ll211,max(1,posO-1),max(arraysize(ll211,"•"),posF+2),"•") // Form III
endIf
zlog “/-/”+“errorNear:”+errorNear
The modified Form III of errorNear is now working correctly, giving errorNear:w9•{•w10•w11
However, Form I (that I was using), or even the very simple Form II are freezing my installation of PanX, often requesting a ForceQuit or even crashing it sometimes.
If I am not mistaken, according to the documentation, Form I and II should return errorNear = “”.
I couldn’t get this code to run because it is missing a parenthesis somewhere. However, I was able to figure out the problem – if the first item is greater than the last item then it will crash. For example, this simple formula will crash:
This bug has apparently been in arrayrange( since it was first added to Panorama X. Amazingly, only one other user has run into this, back in 2017. It will be fixed in the next version.