Solved

UDT property

Posted on 2001-09-02
5
306 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 100 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Spell Check in VB6 13 137
Child Form in front 4 57
Problem to line 23 74
Access2016 ignore hyphen in data entry or searches 5 48
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

726 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