-
March 9th, 2007, 02:49 PM
#1
Over Flow Error !!!
hi all,
I am facing an unusual error.
I've declared a loopCount variable as double
inside a do.. loop until block i'm incrementing this counter by 1.
loopcount = loopcount + 1
If i don't put an end it will loopCount can hold more than 436500 (may run still further but i stopped there !!)
But if i try to put an end to loop by evaluating like this
dim ipass as integer
ipass = 36
if loopcount >= (ipass*1500)
it says ' OVERFLOW'
why it is happening so..
now i really became new to vb ;-(
-
March 9th, 2007, 02:59 PM
#2
Re: Over Flow Error !!!
Tell VB that 1500 isn't a Variant. Make it a Long &
Code:
Option Explicit
Private Sub Form_Activate()
Dim ipass As Integer
ipass = 36
MsgBox (ipass * 1500&)
End Sub
-
March 11th, 2007, 12:22 AM
#3
Re: Over Flow Error !!!
Originally Posted by dglienna
Tell VB that 1500 isn't a Variant. Make it a Long &
Code:
Option Explicit
Private Sub Form_Activate()
Dim ipass As Integer
ipass = 36
MsgBox (ipass * 1500&)
End Sub
Thanks dglienna, Thats was the simple way of understanding simple things...( ones we know the answer everything becoms simple..)
Thanks a lot..
-
March 11th, 2007, 09:36 AM
#4
Re: Over Flow Error !!!
I wish someone would have answered my question quicker a few years ago. I had the same problem, and ended up changing a lot of code before I found the answer.
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
|