|
-
Aug 26th, 2000, 11:26 AM
#1
Thread Starter
Hyperactive Member
Hi,
Why is the following code gives me an overflow error?
Code:
Dim XYZ As Double
XYZ = 365 * 100
Debug.Print XYZ
I've also dimmed XYZ as Long, and Single and still get the error.
Thanks,
Al.
A computer is a tool, not a toy.
-
Aug 26th, 2000, 11:50 AM
#2
Hyperactive Member
that's weird
i tried
Code:
Dim a As Long
Dim b As Long
Dim c As Long
a = 100
b = 365
c = a * b
Print c
that works but don't know if that's what you wanted
[Edited by theman32x on 08-26-2000 at 01:01 PM]
-
Aug 26th, 2000, 12:29 PM
#3
I am having a majorly hard time understanding this but MSDN recommends trying this:
Code:
Dim XYZ As Double
XYZ = CDbl(365) * 100
Debug.Print XYZ
and it appears to work, just dont ask me why!
[Edited by wossname on 08-26-2000 at 01:41 PM]
-
Aug 26th, 2000, 03:09 PM
#4
Hyperactive Member
got it off a site
you must use the CDbl function on it to explicitly make the parameter a Double
??????????????????????????????
would your code be a parameter
??????????????????????????????
[Edited by theman32x on 08-26-2000 at 04:11 PM]
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
|