Previous: 3.2.19. $Q: Overflow Checking Switch To the Table of Contents Next: 3.2.21. $R: Resource file
3.2.19. $Q: Overflow Checking Switch Table of Contents 3.2.21. $R: Resource file

- 3.2.20. -
Table of Contents
3. Compiler Directives
3.2. Switch and Parameter Directives
3.2.20. $R: Range-Checking Switch


3.2.20. $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: 3.2.19. $Q: Overflow Checking Switch To the Table of Contents Next: 3.2.21. $R: Resource file
3.2.19. $Q: Overflow Checking Switch Table of Contents 3.2.21. $R: Resource file

- 3.2.20. -