Language:
Русский
English
$Q: Overflow Checking Switch
Controls the generation of overflow checking code.
Syntax: {$Q+} or {$Q-}
Default: {$Q-}
Type: Local
Menu Command: Options|Compiler|Overflow checking
The $Q+ State
In the $Q+ state, certain integer operations are checked for overflow, such as:
+, -, * Abs, Sqr, Succ, and Pred
The code for each of these arithmetic operations is followed by additional code that verifies that the result is within the supported range.
If an overflow check fails, the program terminates and displays a run-time error message.
Note that {$Q} does not affect the Inc and Dec standard procedures. These procedures are never checked for overflow.
The $Q switch is usually used in conjunction with the $R switch.
Enabling overflow checking slows down your program and makes it larger, so use {$Q+} only for debugging.
The $Q- State
In the $Q- State, no overflow checking is done.