

The $R directive enables or disables the generation of range-checking code. The documents about range-checking states: If it's relevant, when it breaks on that line in the debugger, all the values look as expected, except param1, which shows "Undeclared identifier: 'param1'" when I ask Delphi to evaluate it.

the following line is where it breaks to in the debugger: Perhaps its on the assignment to param1? But why would that be a range-check and not an overflow error, if so? constįunction fxnName(.other params. But I'm not accessing an array on the line it's saying is causing the range-check error. But why would this also trigger a Range-check error? Delphi's documentation and other posts on stack overflow make it sound like range-check errors are usually for array accesses that are out of bounds. I understand why this would cause an overflow, on the multiplication of C1, it seems likely it might exceed the data-type's max valude.
Stick ranger check error code#
Here's a condensed version of some code that causes both a Range check error and an overflow error, should I turn on those compiler check directives.
