effusionx1
08-27-2004, 03:25 PM
Hi there,
I am handling integers in excess of 30 characters.
I have tried dimming the variables which hold these integers, as variant, integer, double, single, long and string but all result in the same error;
"overflow"
what is wrong?
armstrongecom
08-27-2004, 04:47 PM
Unfortunately, my reference says the largest data type is "Decimal" which reserves 14 bytes for 29 characters when used as an integer. So with 30 you may be out of luck.
-Allen
Radchenko
08-27-2004, 04:54 PM
I'm not too keen on Visual Basic, but seems like you'd have to create your own data type. Something like an array of integers which instead of overflowing would just increate the integer in the next array index.
I'm sure theres examples of this on pages like planetsourcecode.com
Radchenko
08-27-2004, 04:57 PM
This looks like it would suite your needs:
http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=51021&lngWId=1
Veign
08-28-2004, 11:57 AM
You may be able to find some to port this code:
MAPM Library (http://www.tc.umn.edu/~ringx004/mapm-main.html)
to a DLL which could be used in VB
Just save the integer as a string, it WONT overflow as a string if you save with quotes. Then when you need the number in integer form, do Val(MyString)
viGeek
08-29-2004, 09:15 AM
Reall depends on what your using it for, each one of those that you mentioned have there seperate purpose. Aside from Variant & String which pretty much suit the same purpose.