I doubt about it : the coder looses the control of its datas after the array allocating condition, if the variables of this condition have changed.
I would say, as with the dynamical arrays, start with a one-cell array (
Dim x.i(0) ) and redim this array in the condition :
In a complex procedure, no initial
Dim divides this procedure in two areas : the first one forbides the coder to use the array, during the second one is allows him to handle the array...
However, it seems that
Protected is not required for arrays. :: I tested it and... yes,
protected is required... I prefer handle dynamic arrays.
@azjio
You can use
SetWindowData(window, *classStruc) in the initial step,
and after :
Code: Select all
Define *this.class = GetWindowData(EventWindow() )
With *this
Debug /x
Debug /y
Debug /width
Debug /height
EndWith
in your callback.
It is far simpler. The array is dynamically allocated :
Code: Select all
Structure class
x.i
y.i
width.i
height.i
Array myArray.i(0)
EndStructure