Hello!
I've been trying to create a window object consisting of several 'subwindows', so that each subwindow has its own properties, which I store in a bunch of two-dimensional parameter arrays, one for each property. Each element in a parameter array represents one of the windows. To illustrate:
For example for the widths, I have defined an array called _widths, so that _widths[1][1] stores the width of the window in the lower left, _widths[2][1] the one to the right of that one and so on, up to _widths[4][3] that stores the width of the window in the top right corner.
The user is able to define the number of horizontal as well as vertical number of windows. The problem I've encountered is that my code is unable to expand the parameter arrays properly when the user sets a number larger than the previous one, e.g. 3 => 4 horizontal windows.
The code I've used is based on the answer given
here. I've tried both creating a new array and setting the parameter array to that one using the 'parameters' command (which works for decreasing the dimensions of the parameter array), and simply defining the new elements in the parameter array (which was the recommended answer to that question), but none of these seem to work for me. Strangely enough, when editing the object in the gdl editor, the array elements are created, but the array seems to retain its dimensions:
However, upon modifying another parameter (which I assume runs the parameter script again?) the dimensions of the array are updated and correctly set to the new dimensions. This of course is not possible for me to do on a placed object, as the parameter script has already crashed further down due to trying to access an out of bounds index and the interface is subsequently only empty.
What would be the correct way to increase the dimensions of the parameter arrays? I know the simple solution for my specific problem would probably be to set a large enough dimensions to the parameter arrays and just not resize them, but that wouldn't really answer my question.
thanks