overflow error

Posted on 2004-11-14
Last Modified: 2010-04-05

i use delphi 5,access
why when my program runs to windows NT : no error
but when it runs under windows xp or other it gives an overflow error

someone can help me?
Question by:ingenosya
    LVL 6

    Expert Comment

    could u plz be more specific on what your program actually does.
    LVL 4

    Expert Comment

    a bit  more information would be usefull.

    when, where, error message ??
    LVL 17

    Expert Comment

    by:Wim ten Brink
    Okay, based on the information you've provided, I can only conclude that you're using some function that returns a value that generates an overflow in W2K while it doesn't in NT. For example, when you ask for the amount of available diskspace, it could be that your NT system has a small disk so the size fits the variable perfectly. But on W2K with a bigger disk the size might be bigger than the variable can handle.
    One option would be to compile your application with Overflow checking turned off in your project options. Then the overflow will still occur but you won't get any notifications about it.
    The other option would be to debug your project on the XP system and wait until the exception is raised.

    And remember, we're not mindreaders. We are good but not that good. If you could be more specific, we could provide more specific help too. ;-)
    LVL 5

    Expert Comment


    Well an overflow is exactly that.

    The number you are using is greater than the type cast of the number.

    I don't remember the exact specifics of them all. In VB an integer can't be bigger than 32k+ (32260 I think).  Likewise a string at one time in Windows had a maximum size of 256 and then when NT first came out it was 64k. (dont know what it is now - but I guess a lot....).

    What you need to do is identify the procedure where the fault is occurring and then increase the size of the numbers (float generally works).

    To find exactly where the problem is put msgbox's every few lines and you will see where the error is occurring.  Don't try to figure it out - just work around it.

    LVL 4

    Expert Comment

    Generic integer types for 32-bit implementations of Delphi  
    Type      Range      Format
    Integer      -2147483648..2147483647      signed 32-bit
    Cardinal      0..4294967295      unsigned 32-bit

    Fundamental integer types  
    Type      Range      Format
    Shortint      -128..127      signed 8-bit
    Smallint      -32768..32767      signed 16-bit
    Longint      -2147483648..2147483647      signed 32-bit
    Int64      -2^63..2^63-1      signed 64-bit
    Byte      0..255      unsigned 8-bit
    Word      0..65535      unsigned 16-bit
    Longword      0..4294967295      unsigned 32-bit

    Fundamental real types
    Type      Range      Significant digits      Size in bytes
    Real48      2.9 x 10^-39 .. 1.7 x 10^38      11-12      6
    Single      1.5 x 10^-45 .. 3.4 x 10^38      7-8      4
    Double      5.0 x 10^-324 .. 1.7 x 10^308      15-16      8
    Extended      3.6 x 10^-4951 .. 1.1 x 10^4932      19-20      10
    Comp      -2^63+1 .. 2^63 -1      19-20      8
    Currency      -922337203685477.5808.. 922337203685477.5807      19-20      8
    The generic type Real, in its current implementation, is equivalent to Double.

    Generic real types
    Type      Range      Significant digits      Size in bytes
    Real      5.0 x 10^-324 .. 1.7 x 10^308      15-16      8

    from the Delphi Help files :)
    LVL 6

    Accepted Solution

    Simplest debugging is to run program under debugger on XP and see what is happening when the overflow occurs. Failing that, try a tool like Eureka Log or MadExcept I've used exceptional magic, but it seems to be dead.
    LVL 1

    Expert Comment

    Yes, ingenosya, please be more specific.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
    Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now