Increments an ordinal value by one or N.
procedure Inc(var X); overload; procedure Inc(var X; N: Longint); overload;
Inc( X); Inc( X, Longint N);
System
In Delphi code, Inc adds one or N to the variable X.
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 increments by 1, or by N if N is specified; that is, Inc(X) corresponds to the statement X := X + 1, and Inc(X, N) corresponds to the statement X := X + N. On some platforms, Inc may generate optimized code, especially useful in tight loops.
If X is a pointer type, it increments X by N times the size of the type pointed to. Thus, given
type
PMyType = ^TMyType;
and
var
P: PMyType;
the statement Inc(P) increments P by SizeOf(TMyType).
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
|
What do you think about this topic? Send feedback!
|