S Saj Active Member Licensed User Jul 29, 2009 #1 Is it possible to re-size an array after the it has been declared as '0' size in Globals? E.g: Sub Globals Dim Type(x,y)reducedArr (0) As Int32 End Sub Sub Calc reducedArr () = Array (100?) 'can an array size of 100 be declared here without assigning any values to the array elements? End
Is it possible to re-size an array after the it has been declared as '0' size in Globals? E.g: Sub Globals Dim Type(x,y)reducedArr (0) As Int32 End Sub Sub Calc reducedArr () = Array (100?) 'can an array size of 100 be declared here without assigning any values to the array elements? End
A Ariel_Z Active Member Licensed User Jul 30, 2009 #2 Yes. See here Variables and at the main help: Basic4ppc - Main Help
Erel B4X founder Staff member Licensed User Longtime User Jul 30, 2009 #3 The actual code is: B4X: Sub Globals Dim Type(x,y)reducedArr (0) As Int32 End Sub Sub Calc Dim reducedArr(100, 2) As Int32 End Sub Structures in Basic4ppc are actually arrays. The last dimension size should be equal to the number of parameters (2 here).
The actual code is: B4X: Sub Globals Dim Type(x,y)reducedArr (0) As Int32 End Sub Sub Calc Dim reducedArr(100, 2) As Int32 End Sub Structures in Basic4ppc are actually arrays. The last dimension size should be equal to the number of parameters (2 here).
S Saj Active Member Licensed User Jul 30, 2009 #4 thanks, that would have taken me a while to figure out