View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Walter Briscoe Walter Briscoe is offline
external usenet poster
 
Posts: 279
Default user-defined data type capabilities

It seems I use Microsoft Visual Basic 6.5 from Microsoft Excel 2003.

I've just introduced my first user-defined data type (UDT) to a module.
I found it greatly simplified passing parameters.

Private Type Journey
Depart As String
Arrive As String
End Type

What can I do with such UDTs?
1) Declare functions and scalar, array, and parameter variables.
2) Assign e.g. Dim A as UDT, B as UDT: A = B
3) Not compare variables. e.g. if UDT0 = UDT1 ... gets an error.

What else can UDTs be used for?

When, in the Visual Basic Editor (VBE), I hover over code referencing a
variable or expression of a predefined type (Byte, Boolean, Integer,
....), the VBE displays its value.
Can this be extended to UDTs?
if so, how?

I assume such code would avoid the type mismatch I get if I do "?UDT" in
the immediate window.
--
Walter Briscoe