|
-
Dec 10th, 1999, 01:04 AM
#1
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).]
-
Dec 10th, 1999, 01:08 AM
#2
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
-
Dec 10th, 1999, 12:15 PM
#3
Junior Member
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
-
Dec 10th, 1999, 12:43 PM
#4
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
-
Dec 10th, 1999, 12:57 PM
#5
Junior Member
As you said I tried value=cint(vlong), It gives the error message "Overflow".
Latha
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|