Previous: $Q: Overflow Checking Switch To the Table of Content Next: $R: Resource file

- 3.2.20 -
Compiler Directives
Switch and Parameter Directives

$R: Range-Checking Switch

Targets: MS-DOS, OS/2, Win32


Compiler directives

Enables and disables the generation of range-checking code.

Syntax:
  {$R+} or {$R-}
Default:
  {$R-}
Remarks:
The $R switch is usually used in conjunction with the $Q switch.

If {$R+} defined, all array and string-indexing expressions are verified as being within the defined bounds all assignments to scalar and subrange variables are checked to be within range.

If a range-check fails, the program terminates and displays a run-time error message.

Enabling range-checking slows down your program and makes it larger. We recommend to use {$R+} only for debugging purposes.

Keep in mind that range-checking mode affects even on “+“, “*“ and Shl operators.


Previous: $Q: Overflow Checking Switch To the Table of Content Next: $R: Resource file
$Q: Overflow Checking Switch Table of Content $R: Resource file

- 3.2.20 -