Q: variant data type with user defined data type 
Author Message
 Q: variant data type with user defined data type

I have two user defined data type. The first one is like this

Type Message
        Code as integer
        Body as variant
End Type

Type Body_1
        ....
        ....
End Type

Type Body_2
        ...
        ...
End Type

Depending on the code, I need Body to point to Body_1 or Body_2. As I found
out last night I can't put a variant point to a user definet data type. The
option I see now is to use a class instead of a user defined data type. I
would like to know if using a class it is going to work ? Is it going to be
slower ? Is there a better solution ?
Thanks,
   Luis P. Furtado



Tue, 18 Apr 2000 03:00:00 GMT  
 Q: variant data type with user defined data type



Quote:
>Depending on the code, I need Body to point to Body_1 or Body_2. As I found
>out last night I can't put a variant point to a user definet data type. The
>option I see now is to use a class instead of a user defined data type. I
>would like to know if using a class it is going to work ? Is it going to be
>slower ? Is there a better solution ?

If you are using only two different records, you can allocate an array of
each Type, and have the type indicator and array index in the Message
record. This will be at least the fastest implementation. You can wrap the
code in a class, but using classes always will slow down handling and
access to the data.

DoDi



Thu, 20 Apr 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Type mismatch on user defined data type

2. VB4: Help: data-alignment in user defined data types

3. Help: data-alignment in user defined data types

4. Compile error: User-defined data type not defined!

5. How to read Excel cells data types without Variant types

6. Passing Array or a user defined data type as a parameter to a storedprocedure in Oracle

7. HELP user defined data types

8. visual basic user defined data types

9. Assigning recordset recodset to a user Defined Data Type

10. User defined type and variant ?

11. binary files and user defined data types

12. Sorting arrays of user defined data type

 

 
Powered by phpBB® Forum Software