Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User Defined Type Within User Defined Type 1

Status
Not open for further replies.

rmahawaii

Programmer
Oct 21, 2002
29
HK
How can I have a user defined type with a user defined type? The follow would generate a compiler error of "Forward Reference to user-defined type". Thanks in advance.

Private Type InputDetail
RecordCode As String * 1
ResultCode As String * 5
detaildata As DetailRecord '<-----------
End Type

Private Type DetailRecord
DetailCode as String * 5
Details as String * 30
End Type
 

It just like an API that uses a defined type as part of its parameters. The defined type need to come before the API. So in your case all you need to do is to switch them around to...
[tt]
Private Type DetailRecord
DetailCode As String * 5
Details As String * 30
End Type

Private Type InputDetail
RecordCode As String * 1
ResultCode As String * 5
detaildata As DetailRecord
End Type
[/tt]

and it should work

Good Luck

 
Wow...that did the trick...you are my life saver...thanks vb5prgrmr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top