Visual Basic
Programming With VariantsVisual Basic - Programming With Variants
Programming With Variants
Overview of Variants
Internal Structure
Using Variants Instead of Simple Data Types
Performance Doesn't Matter
Memory Doesn't Matter
Type Safety
Flexibility
Defensive Coding
Using the Variant as a General Numeric Data Type
Using Variants Instead of Objects
Other Variant Subtypes
Empty and Null
Arrays
User-Defined Types
Side effects when passing by reference
Microsoft Visual Basic 6 further enhances the Variant data type from the previous version so that it can now hold user-defined types (UDTs). This creates yet another reason why you should become familiar with Variants and what they can do. In this tutorial I will take an in-depth look at Variants and discuss the benefits and pitfalls of programming with them.