The script seems correct, I don't see issues except a possible problem caused by the first instruction that may make "putarray 0 -1 Name" to work from Ncount instead of 0.
Then do you know that the first index of an array is 0 and not 1? "GetArray cell 0 5" takes the 6th element, just like 'i'.
aluigi wrote:Then do you know that the first index of an array is 0 and not 1? "GetArray cell 0 5" takes the 6th element, just like 'i'.
i'm ok with that
aluigi wrote:The script seems correct, I don't see issues except a possible problem caused by the first instruction that may make "putarray 0 -1 Name" to work from Ncount instead of 0.
You are right. I removed "PutArray 0 Ncount 0" and it works. Thank you.
But how i should initialize an array? Ncount is number of strings in Name table
aluigi wrote:It's highly suggested to pre-allocate the array if you know the max value, example: PutArray 0 FILES 0
You can initialize it like you did but then you must specify the correct index with putarray and not -1 which appends the element at the end. So you must use "putarray 0 i Name", just that.
aluigi wrote:You can initialize it like you did but then you must specify the correct index with putarray and not -1 which appends the element at the end. So you must use "putarray 0 i Name", just that.