Link to home
Start Free TrialLog in
Avatar of Kapusta
Kapusta

asked on

Range Check Error

I have a Delphi 3 application that works flawlessly on hundreds of customers' PCs.  But now I get a report from just one customer who says that my application keeps spitting out "Range Check Error" messages when she attempts to perform various functions...functions that the other hundreds of customers likewise perform everyday... but they never receive such error messages.

In any case, I am stumped as to what a Range Check Error is in the first place.  Can I get some examples of what would trigger Range Check Error runtime errors?

Thanks.
Avatar of jasongth
jasongth

Hi,

I sometimes get a range check error because of the array size indexing; the index has become out of bound of the maximum allowed or declared.  That means something similar to 'Index Out of bound' problem in C++.
ASKER CERTIFIED SOLUTION
Avatar of windharp
windharp

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Wim ten Brink
Is the compoler option "Range checking" on or off in your project. If it's off, the bug might not be related with something YOU wrote...
Normally, you would turn this option off in the final build of your application since you've tested it thoroughly and am sure this error won't occur. ;-) It could be that she accidently got a version with the compiler setting on...
One other thing to add to the above: the user has entered data which may be valid for the field it is stored in, but is out of range of the function(s) used to process it. For example, entering £1,000,000 when the field can only take £999,999.

Geoff M.
Range Check Error occurs if the appropriate compiler switch is on ({$R+}) and the value inside some variable becomes too big for its size. It can occur if, for example, you increase/decrease the value by some arithmetic operation. Note that you will receive RCE even with bitwise operations, like shl.

Best regards,
  Sasha
Avatar of Kapusta

ASKER

>> Range Check Error occurs if the appropriate compiler switch is on

I have checked my Delphi 3 compiler options, and I see that run time "Range checking" is turned OFF.  Nor do I include any {$R+} flags in my code.   So how is it that if I have range checking turned off that this one customer says that nearly every function of my program triggers "Range Check Error" messages?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you. Please tell us where was the problem, I am very curious.

Best regards,
  Sasha
Avatar of Kapusta

ASKER

>> Please tell us where was the problem, I am very curious

I have no idea where the problem is.  Nothing has been solved.  I sent an email to the customer to do some more tests, but they have not replied.  I'm in limbo.  I just decided to award the points so that this question did not remain hanging around.
Please inform us if you find out something.

Best regards,
  Sasha
If you did not get a satisfying answer, next time ask for a refund instead. You can post a message in the community support area for free, put the link to the question in the message and ask for a refund.
Avatar of Kapusta

ASKER

>> Please inform us if you find out something

After pulling some teeth, I finally got an important missing fact from the customer.  She is (trying to) running my Delphi application under Windows ME on an Apple iMac!  ...using something called Virtual PC(?)

She said my 2 year old Delphi 1 version worked fine on her iMac, but my newer version which was compiled under Delphi 3 causes the range check errors.

Anyone know more about this iMac Windows emulator software?  I suspect it is the culprit?
Delphi 1 is 16-bit version, all other versions are 32-bit. Apparently, that emulator is not perfect...

Best regards,
  Sasha