Solved

Type Statement Question

Posted on 2002-07-26
3
167 Views
Last Modified: 2010-05-02
Hello Experts:

Is there a way to (re)initialize a type statement so all of the elements of that type statement are reset.  For Instance:

Private Type TestType
 a as string
 b as integer
 c as double
End Type

Dim X as TestType

I'd like to be able to issue a command to initialize a,b and c.

Is this possible or does each element need to be initialized?

VB 6.0
0
Comment
Question by:escheider
[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
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 25 total points
ID: 7180703
If i understood what you need:
You don't have to initialize each, just only what you need. Take in mind that if you not initialize every memebre, it will takes default valus for each type (o to integer/long..., empty string for strings, false for boolean and so on)

Now, if you want to clear all initialized valñues for a given variable of type TestType, just declare another one:

dim other as TestType
set X = other
0
 
LVL 4

Author Comment

by:escheider
ID: 7180712
Answers my question.....
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7180785
thanks for "A" grade. Sorry for my typing errors :)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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
VB6 Compile Compatibility Issue 4 128
SLMGR Switches Are Not Working On KMS Host 3 169
How to make an ADE file by code? 11 106
Error with a code discussed on this page 5 47
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

738 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