Decrements a variable by 1 or N.
procedure Dec(var X); overload; procedure Dec(var X; N: Longint); overload;
Dec( X); Dec( X, Longint N);
System
In Delphi code, Dec subtracts one or N from a variable.
X is a variable of an ordinal type (including Int64), or a pointer type if the extended syntax is enabled.
N is an integer-type expression.
X decrements by 1, or by N if N is specified; that is, Dec(X) corresponds to the statement X := X - 1, and Dec(X, N) corresponds to the statement X := X - N. On some platforms, Dec may generate optimized code, especially useful in tight loops.
If X is a pointer type, it decrements X by N times the size of the type pointed to. Thus, given
type
PMyType = ^TMyType;
and
var
P: PMyType;
the statement Dec(P) decrements P by SizeOf(TMyType).
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
|
What do you think about this topic? Send feedback!
|