Hi,
I'm having an overflow error in VB 6.0 when using the Clong
datatype because of really big values. How to overcome this? Is there anything else available higher than the Clong
datatype?
Hi,
I'm having an overflow error in VB 6.0 when using the Clong
datatype because of really big values. How to overcome this? Is there anything else available higher than the Clong
datatype?
You could use a Double instead of a Long since it can hold larger numbers. The function is CDbl() instead CLng().
In VB6.0, a Long is 32-bits and can hold values up to: 2,147,483,648
A Double is 64-bits and can old values up to: 1.79769313486231570E+308
EDIT: Please refer to this reference
Well, you could try this library: http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=403&lngWId=10
I believe the upcoming VB in MSVS2010 has the CLonger
(64 bits), CEvenLongerYet
(128 bits) and CTooDamnLongForSensibleUse
(256 bits) data types.
</humor>
Depending on how big your really big values are, the VB6 Currency data type might be a good choice.
It supports values in the range -922,337,203,685,477.5808 to 922,337,203,685,477.5807.
Here are some options from the VB6 reference manual topic on data types