Re: [Gambas-user] gb3: using array of structures with dimensions unknown until runtime

2012-07-04 Thread Emil Lenngren
When you are declaring the array by writing A[3] As Single you declare an inline array, i.e. NOT a reference to an array. So you cannot write ThatStruct.A = AnArray. Instead you have to copy the contents from AnArray into A. 2012/7/4 Kevin Fishburne kevinfishbu...@eightvirtues.com On 07/04/2012

Re: [Gambas-user] gb3: using array of structures with dimensions unknown until runtime

2012-07-04 Thread Kevin Fishburne
On 07/04/2012 05:42 AM, Emil Lenngren wrote: When you are declaring the array by writing A[3] As Single you declare an inline array, i.e. NOT a reference to an array. So you cannot write ThatStruct.A = AnArray. Instead you have to copy the contents from AnArray into A. I'm not sure how to

Re: [Gambas-user] gb3: using array of structures with dimensions unknown until runtime

2012-07-04 Thread tobi
On Wed, 04 Jul 2012, Kevin Fishburne wrote: On 07/04/2012 05:42 AM, Emil Lenngren wrote: When you are declaring the array by writing A[3] As Single you declare an inline array, i.e. NOT a reference to an array. So you cannot write ThatStruct.A = AnArray. Instead you have to copy the

Re: [Gambas-user] gb3: using array of structures with dimensions unknown until runtime

2012-07-04 Thread Benoît Minisini
Le 04/07/2012 06:06, Kevin Fishburne a écrit : I need to create a 2D array of a structure like this: Public Struct Tile_Normals A[3] As Single ' Normal for quad subsurface A. B[3] As Single ' Normal for quad subsurface B. End Struct Dim Normals As New Tile_Normals[TileGrid.Size,

Re: [Gambas-user] gb3: using array of structures with dimensions unknown until runtime

2012-07-04 Thread Emil Lenngren
As Benoît says, Dim Normals As New Tile_Normals[TileGrid.Size, TileGrid.Size] only gives an array where you can store references to Tile_Normals. You also have to do: Dim I As Integer Dim J As Integer For I = 0 To TileGrid.Size - 1 For J = 0 To TileGrid.Size - 1 Normals[I, J] = New

Re: [Gambas-user] gb3: using array of structures with dimensions unknown until runtime

2012-07-04 Thread Benoît Minisini
Le 04/07/2012 06:06, Kevin Fishburne a écrit : I need to create a 2D array of a structure like this: ... By the way, Kevin, did you try the jit compiler for your game? -- Benoît Minisini -- Live Security Virtual

[Gambas-user] gb3: using array of structures with dimensions unknown until runtime

2012-07-03 Thread Kevin Fishburne
I need to create a 2D array of a structure like this: Public Struct Tile_Normals A[3] As Single ' Normal for quad subsurface A. B[3] As Single ' Normal for quad subsurface B. End Struct Dim Normals As New Tile_Normals[TileGrid.Size, TileGrid.Size] When I try to assign a value to an

Re: [Gambas-user] gb3: using array of structures with dimensions unknown until runtime

2012-07-03 Thread Kevin Fishburne
On 07/04/2012 12:06 AM, Kevin Fishburne wrote: I need to create a 2D array of a structure like this: Public Struct Tile_Normals A[3] As Single ' Normal for quad subsurface A. B[3] As Single ' Normal for quad subsurface B. End Struct Dim Normals As New Tile_Normals[TileGrid.Size,