User Data Type

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I am confused on the use of user-defined data types.
I would like to add different 'types' to an array, then output the array contents to a listbox.
Do I have to add each element to the array, making the array multi-dimensional, or does the whole 'type' pass to the array?

I did not find too much on this in the kb, so if there are other places that I can read on this subject, please let me know.

Thanks.

Terry
 
Marsh,
Thanks for your reply.
Your example helped me understand.

Terry
-----Original Message-----
array multi-dimensional, or does the whole 'type' pass to
the array?
 
Terry said:
I am confused on the use of user-defined data types.
I would like to add different 'types' to an array, then output the array contents to a listbox.
Do I have to add each element to the array, making the array multi-dimensional, or does the whole 'type' pass to the array?


Yyou can declare an array of a type

Type MyType
x As Long
y As Long
End Type

sub test()
Dim ary(5) As MyType

ary(0).x = 123
ary(0).y = 456

I don't understand what the rest of your question is.
 
Back
Top