Overflow 6 message

[b][red]This message was edited by mcarle5 at 2007-1-30 14:2:33[/red][/b][hr]
I made some changes to and recompiled my Visual Basic 5.0 application. When I run it, I get an error. Err.Number = 6 and Err.Description = Overflow. I have tried compiling to P-Code, to Native Code with no optimizations, but I still get the error. Any ideas????

Thank You


Comments

  • : [b][red]This message was edited by mcarle5 at 2007-1-30 14:2:33[/red][/b][hr]
    : I made some changes to and recompiled my Visual Basic 5.0 application. When I run it, I get an error. Err.Number = 6 and Err.Description = Overflow. I have tried compiling to P-Code, to Native Code with no optimizations, but I still get the error. Any ideas????
    :
    : Thank You
    :
    :
    :

    Those are programming errors and won't go away by changing the eventual 'format' of the code.
    Don't compile your application - run it and test it using the debugger (if that's possible in VB5?). If not, check for the parts of the code where you handle numbers (multiplication, addition, loops?) and put debug statements in there.
    But I ofcourse advise the debugger if you have it.


    Best Regards,
    Richard

  • : : [b][red]This message was edited by mcarle5 at 2007-1-30 14:2:33[/red][/b][hr]
    : : I made some changes to and recompiled my Visual Basic 5.0 application. When I run it, I get an error. Err.Number = 6 and Err.Description = Overflow. I have tried compiling to P-Code, to Native Code with no optimizations, but I still get the error. Any ideas????
    : :
    : : Thank You
    : :
    : :
    : :
    :
    : Those are programming errors and won't go away by changing the eventual 'format' of the code.
    : Don't compile your application - run it and test it using the debugger (if that's possible in VB5?). If not, check for the parts of the code where you handle numbers (multiplication, addition, loops?) and put debug statements in there.
    : But I ofcourse advise the debugger if you have it.
    :
    :
    : Best Regards,
    : Richard
    :

    I am using the debugger. It's trying to move a value into an Integer field. If the "From value" is larger than 32767, it gets the overflow error. It's my understanding that Integer fields can handle numbers larger than 32767. This is a test version of the application. The production version goes against the same data but does not get the overflow error. The only difference is the .exe. That's why I was thinking it was the way I compiled it.
    :

  • :
    : I am using the debugger. It's trying to move a value into an Integer field. If the "From value" is larger than 32767, it gets the overflow error. It's my understanding that Integer fields can handle numbers larger than 32767. This is a test version of the application. The production version goes against the same data but does not get the overflow error. The only difference is the .exe. That's why I was thinking it was the way I compiled it.
    : :
    :
    :

    After compiling, overflow checks should still be present, unless you have explicitly turned them off.

    Anyway, Integer... what's an integer? :P VB uses 16 bits signed integer numbers for Integer, and 32 bits signed for Longs.
    Atleast VB6 does. In VB5 it might be different, but you can most likely look it up somewhere in help or on the internet.

    Now an unsigned integer of 32 bits can hold 2^32 different value. If we start count at 0, then the max value is 2^32 - 1.
    If you make it signed however, you're using one bit for saying if it's + or -. So 2^31 different values for + and for -.
    If you think about it, you get to the following problem: 2^32 is even... so where does the 0 belong to?
    It is generally accepted that the 0 goes with +, so max value is 2^31 - 1 and minimum value is -2^31.

    For any other length datatype, simply replace 32 and 31 by the right number of bits... the formula's hold.

    Best Regards,
    Richard

  • : :
    : : I am using the debugger. It's trying to move a value into an Integer field. If the "From value" is larger than 32767, it gets the overflow error. It's my understanding that Integer fields can handle numbers larger than 32767. This is a test version of the application. The production version goes against the same data but does not get the overflow error. The only difference is the .exe. That's why I was thinking it was the way I compiled it.
    : : :
    : :
    : :
    :
    : After compiling, overflow checks should still be present, unless you have explicitly turned them off.
    :
    : Anyway, Integer... what's an integer? :P VB uses 16 bits signed integer numbers for Integer, and 32 bits signed for Longs.
    : Atleast VB6 does. In VB5 it might be different, but you can most likely look it up somewhere in help or on the internet.
    :
    : Now an unsigned integer of 32 bits can hold 2^32 different value. If we start count at 0, then the max value is 2^32 - 1.
    : If you make it signed however, you're using one bit for saying if it's + or -. So 2^31 different values for + and for -.
    : If you think about it, you get to the following problem: 2^32 is even... so where does the 0 belong to?
    : It is generally accepted that the 0 goes with +, so max value is 2^31 - 1 and minimum value is -2^31.
    :
    : For any other length datatype, simply replace 32 and 31 by the right number of bits... the formula's hold.
    :
    : Best Regards,
    : Richard
    :
    : There were no datatype changes in the code. The code that is giving me the error has not changed. I'm having an issue knowing what to look at. The test .exe has the problem. The production .exe does not have the problem. When I debug the test project, it has the problem. When I debug the production project, it has the problem.

  • Well in that case post the code.

    But when it gives the error, can't you click something like Debug or Break or some button that'll show you the code where it goes wrong?
    If you could pinpoint the line, you know where the problem lies.
    If you want further help, some code would be very helpful.

    Best Regards,
    Richard

  • : Well in that case post the code.
    :
    : But when it gives the error, can't you click something like Debug or Break or some button that'll show you the code where it goes wrong?
    : If you could pinpoint the line, you know where the problem lies.
    : If you want further help, some code would be very helpful.
    :
    : Best Regards,
    : Richard
    :
    :
    Line of code causing problem:
    iCaseSeqNum = cboInsuredNames.ItemData(cboInsuredNames.ListIndex)

    icaseSeqNum is defined as an Integer.

    cboInsuredNames.ItemData(cboInsuredNames.ListIndex) has values anywhere from 1 on up. The statement works fine as long as the number is <= 32767. The statement causes an err.Number = 6 err.Description = Overflow if the number is > 32767. This has been working for years without a problem with numbers > 32767. I compiled on a Windows 2000 platform and started getting the errors. I found that previous compiles were done on a Windows 98 platform. Could that be an issue?
  • Rather than guessing, use a Long.

    Best Regards,
    Richard

  • In Regional Settings change the decimal symbol as "," and the grouping symbol is ".", so I resolved the problem by themselves.
  • good source of information, thanks for this information...

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories