Range Check Error and Delphi 7.0 -


After checking and fixing a week for memory leaks via FastMM4, I finally ran my program on a separate PC. Now, I'm getting a "range check error". I have spent hours exploring this online, but none of them tells me what I see. My program was comply with runtime error option range check. So, I know why I am making a mistake, but I have to know why the error has increased.

The program was compiled in Delphi 7.0 on XP. The test PC is a Windows 7. As soon as it starts, my program starts to communicate through the serial port and then the "Range check error" is followed by the message box. When I stop serial communication, there are no "Range check error" boxes. What does it mean and how do I resolve it? I'm looking for a simple strategy. I know that I can check line line.

"Range check error" due to improper assignment of values ​​or access to an inaccessible index of an array. Am I right?

Your understanding of border check errors is correct, they arise when you use the array outside a range We do. For example:

  type TFixedArray = array [0..41] of integer; Var a: TFixedArray; Start a [42]: = 1 + 2; // !! This is a boundary check error !! End;   

or for a dynamic array:

  var a: array of integers; Settlend start (A, 666); A [665]: = 12; // it's ok [666]: = 42; // !! This is a boundary check error !! End;   

I have illustrated it with assignments, but reading an array with an index will also cause an error outside the range.

The boundary error should be reported to an address on which this happens, after which you can translate the code into your location with the map file. If you were using the Madaxer or some such device then it would be even better.


UPDATE

Ken has indicated, which is influenced by the states, the range probe option is as follows:

In the case of {$ R +}, all the array and string-indexing expressions are verified within the defined range, and all of the scalar and suburban variants must be within the range specified.

Comments