[Gambas-user] integer array in struct ?
    Bruce Bruen 
    bbruen at ...2308...
       
    Tue Oct 25 11:44:49 CEST 2011
    
    
  
On the other hand, the following piece of garbage is also correct.
Better minds than I will have to tell you what's in the array.
' Gambas module file
Public Struct axis
  i As Integer 
  f As Float
  ia As Integer[]
End Struct
Public Sub Main()
Dim testit As New Axis
Dim x As Integer
Dim y As Integer
testit.ia = New Integer[][]
testit.i = 212
testit.f = Pi()
For x = 0 To 120
  If x Mod 2 = 0 Then
    testit.ia.Add(x, 0)
    Print "Seagoon:\tYing ";
  Else If x Mod 5 = 0
    testit.ia.Add(x, 1)
    Print "Tong\nBluebottle:\tTiddle-I-Po"
  Else 
    testit.ia.Add(x, 2)
    Print "Tong"
  Endif
Next
Print " Tong\nBluebottle/Seagoon:\tTiidle-i-Po\nAll:\tTiddle-I-Po"
Print "Grippype-Thin:\tOh Min, that N-n-n-eddy, he'll be the death of us
yet!"
End
Clue! All you have done in the struct is to declare "ia" to be an
integer array, it's not till you (or any other programmer) instantiates
it - any old way they like - that it's dimensionality and cardinality is
decided.  
Good luck!
Bruce
    
    
More information about the User
mailing list