Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

EIntOverflow exception in tabs.pas

edited December 2010 in General
Hi,

Using DXE and 12.03.

I am getting an unusual EIntOverflow exception when designing a report
containing a subreport (although it sometimes happens when switching
between the designer data, calc, design & preview tabs.

I can see why this might happen and if you check the code below you'll
see why.

The exception is raised in TTabSet.DoDefaultPainting in the Tabs unit.

The code raising the exception is:

...
Inc(TabPos.Size, 1);
Inc(TabPos.StartPos, Tab - 1); { << exception here }
...

The value of TabPos.StartPos is 14 and Tab is 0 when the error occurs.

TabPos is declared as:
TTabPos = packed record
Size, StartPos: Word;
end;

I'm assuming the error must be due to mixing Word and Integer values in
the call to Inc().

However, this suggests a serious flaw in the Tabs unit and I'm
surprised others aren't seeing this error regularly.

Changing the code as follows no longer raises the exception.

TabPos.StartPos := TabPos.StartPos + ( Tab - 1 );

Any thoughts please? Is anyone else seeing the EIntOverflow regularly?

Regards, Paul.

Comments

  • edited December 2010
    Hi Paul,

    Are you able to reliably create this error with a set of steps? If so,
    please send the steps I can take (perhaps with the end-user demo) to
    recreate the problem here and I'll take a look at it for you.


    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited December 2010
    Nico Cizik (Digital Metaphors) wrote:


    Thanks Nico,

    It is my fault. It's due to my having a couple of modified vcl source
    units and compiling with range and overflow checks on when they should
    be off (at least they should for the vcl source).

    --
    Regards, Paul.
This discussion has been closed.