?
Solved

UDT property

Posted on 2001-09-02
5
Medium Priority
?
309 Views
Last Modified: 2006-11-17
I would like to return a udt as a property for a class.   Is it possible?  I dont want to make another class because this class has many properties that must be this type.
0
Comment
Question by:vblogic
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6449580
I think that you need to return as variant, but working with it like an UDT.
0
 
LVL 1

Author Comment

by:vblogic
ID: 6449588
Richie,
Even if I declare as Variant, it gives me compile error because it knows I am trying to return a UDT.

Example:

Private m_udtSample As UDTSample

Public Property Get SampleProperty() As Variant
   SampleProperty = m_udtSample
End Property
0
 

Accepted Solution

by:
ruchir_khanduri earned 400 total points
ID: 6450074
A User Defined Type (UDT) allows the programmer to create a complex data type by combining the Visual Basic data types like String, Double, and Integer. The following code defines a Customer data type made up of string, numeric, and date values:

Type Customer
   Name As String
   CreditLimit As Currency
   BirthDate As Date
End Type

Public Function UDTRoutine (CustomerData As Customer) _
As Customer

    A developer could call the function like this, both passing a UDT and accepting the function's return value into a UDT variable:

Dim udtData As Customer
udtData.Name = "Peter Vogel"
udtData.BDate = "31/05/53"
udtData.CreditLimit = 200

udtData = obj.UDTRoutine(udtData)

    In Visual Basic 5.0, you can not pass or return UDT's to methods and some containers will not allow you to use UDT's.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7087199
Hi vblogic,
You've requested to delete this question, but its status has remained as 'Pending Delete' because one or more comments have been added.  Normally, the only way to fully delete such a Question is to post a message to Community Support and ask for assistance.

EE is making a one-time database sweep to purge the Pending Delete Questions automatically.  During this sweep:

    vblogic -- To allow the deletion to proceed:  Do nothing.
    EXPERTS -- Please DON'T POST a comment except to contest this deletion.

In the future, please refer to http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp#8 for instruction on deleting questions.

DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7108268
Finalized by Moondancer - EE Moderator
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses
Course of the Month14 days, 3 hours left to enroll

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question