When a numeric variable or constant is assigned to a variant it appears that PB only creates variants of type 5 (Double) or 3 (Long) unless you specify AS Type in the assignment
Based on some testing, it appears that unless you specifically use AS Type in your assignment
'
Note using "AS EXT" in the assignemnt causes a compile error. It is not supported as a variant type
Based on some testing, it appears that unless you specifically use AS Type in your assignment
- All Floats (variable or constant) are converted to Double (VT = 5)
- Integral constants (including Quads) less than or equal to the maximum value of a Long are converted to Long. (VT=3)
- Integral variables other than Quads are converted to Longs (VT = 3)
- All Quad variables and Quad constants larger than the maximum value of a Long are converted to Double.(VT = 5)
'
Code:
vq1 = 77777777777777777&& ? STR$(VARIANTVT(vq1)) 'returns 5 (double) vq2 =77777777777777777&& AS QUAD ? STR$(VARIANTVT(vq2)) 'returns 20 (quad) '
Comment