J
John Dann
Is it possible in VB.net to have arrays of structures (ie UDTs) where
the structure definition includes one or more arrays? Something like:
Structure MyUDT
ItemOne () as byte 'for example
sub new(byval dimension as integer)
redim itemone(dimension)
end sub
End structure
dim MyArray as myudt = new myudt(n)
' where n is known
'This works, but
dim Myarray() as myudt = new myudt(n)
gives a design-time error even before redimming the array.
I've got 3 options:
1. I can no longer have this sort of UDT array in VB.net (I'm sure I
used to have something similar working in VB6).
2. It is possible but needs a different syntax/declaration.
3. It is possible and the syntax above ought to work, but I've made a
mistake in my own code (the real UDT is much more complicated than the
example above and includes several such arrays in the UDT definition.
Though I've checked it's still possible that there might be a
typing/coding error).
Any help with this would be much appreciated - it's a key part of a
current project.
John Dann
the structure definition includes one or more arrays? Something like:
Structure MyUDT
ItemOne () as byte 'for example
sub new(byval dimension as integer)
redim itemone(dimension)
end sub
End structure
dim MyArray as myudt = new myudt(n)
' where n is known
'This works, but
dim Myarray() as myudt = new myudt(n)
gives a design-time error even before redimming the array.
I've got 3 options:
1. I can no longer have this sort of UDT array in VB.net (I'm sure I
used to have something similar working in VB6).
2. It is possible but needs a different syntax/declaration.
3. It is possible and the syntax above ought to work, but I've made a
mistake in my own code (the real UDT is much more complicated than the
example above and includes several such arrays in the UDT definition.
Though I've checked it's still possible that there might be a
typing/coding error).
Any help with this would be much appreciated - it's a key part of a
current project.
John Dann