-
Are you trying to get around the error? You can't if the long is less than -32,768 or greater than 32,767. By the way, look up CInt in help and you will find a discussion of various conversions.
------------------
Marty
[This message has been edited by MartinLiss (edited 12-10-1999).]
-
It happens because you're trying to convert the number that is already bigger then Integer's maximum value (32,767), that's why generates an error (6 - Overflow).
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
-
All,
How shall I do the datatype conversion from Long to Integer.
I did the following.
Dim vlong as long
dim value as integer
value=int(vlong). But I am getting the result that I expect.
Thanks.
Latha
-
Well, Long is already an integer type, as a matter of fact "Long" is just convenient shorthand for "Long Integer". The difference between Long and Integer is the the former can store larger numbers. If you do value = cInt(vlong) or just value = vlong, VB will do the "conversion" for you, but you will get an error if vlong is too large.
------------------
Marty
-
As you said I tried value=cint(vlong), It gives the error message "Overflow".
Latha