User Data Type

T

Terry

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
 
T

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?
 
M

Marshall Barton

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top