kevindurette
Mechanical
- May 4, 2008
- 79
Think of this small example.
I want to write my own data type class to handle numerical data of a different type, such as with complex numbers or high-precision floating point numbers. Is it possible to write a class that allows you to simply swap out the datatype in the above code (from "Double" to "clsSuperDuperDataType" and have something that works out of the box, working with VBA's built-in arithmetic operators and even with literal declarations? Doing a "find and replace" on existing code is where I'd like to go with this.
Thanks.
Durette
Code:
Dim dblA as Double
Dim dblB as Double
Dim dblC as Double
dblA = 2
dblB = 4
dblC = dblA + dblB
MsgBox dblC
'Returns 6
Thanks.
Durette