求函数dec()的功能 ( 积分: 10 )

  • 主题发起人 主题发起人 delphi0808
  • 开始时间 开始时间
D

delphi0808

Unregistered / Unconfirmed
GUEST, unregistred user!
Dec(Message.Msg, WM_LBUTTONDBLCLK - WM_LBUTTONDOWN)
进行何种操作?
 
Message.Msg := Message.Msg - (WM_LBUTTONDBLCLK - WM_LBUTTONDOWN)
 
从集合中减除?
 
Message.Msg, WM_LBUTTONDBLCLK , WM_LBUTTONDOWN
这些都是integer类型的常量
Decrements a variable by 1 or N.//变量减去1orN

Unit

System

Category

ordinal routines

Delphi syntax:

procedure Dec(var X[
N: Longint]);

Description

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. However, Dec generates optimized code and is especially useful in tight loops.

Note: 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).

Warning: Do not use Dec on ordinal-type properties if the property uses a write procedure.
 
后退
顶部