Range checking

 

Type          Switch

Syntax      {$R+} or {$R-}

{$RANGECHECKS ON} or {$RANGECHECKS OFF}

Default     {$R-}

{$RANGECHECKS OFF}

Scope       Local

 

Remarks

The $R directive enables or disables the generation of range-checking code. In the {$R+} state, all array and string-indexing expressions are verified as being within the defined bounds, and all assignments to scalar and subrange variables are checked to be within range. If a range check fails, an ERangeError exception is raised (or the program is terminated if exception handling is not enabled).

Enabling range checking slows down your program and makes it somewhat larger, so use the {$R+} only for debugging.

Note:          Long strings are not range checked.

 

Compiler directives (list)