delphi常用函数六

1、 TDataSet.Edit

Enables editing of data in the dataset.

procedure Edit;

Description

Call Edit to permit editing of the active record in a dataset. Edit determines the current state of the dataset. If the dataset is empty, Edit calls Insert. Otherwise Edit

Calls CheckBrowseMode to post any pending changes to a prior record if necessary.

Checks the CanModify property and raises an exception if the dataset can’t be edited.

Calls the BeforeEdit event handler.

Retrieves the record.

Puts the dataset into dsEdit state, enabling the application or user to modify fields in the record.

Broadcasts the state change to associated controls.

Calls the AfterEdit event handler.

2、 TStringStream.DataString

Provides direct access to the string that stores the text represented by the TStringStream object.

property DataString: string;

Description

Use DataString to get access to the text of the stream. The text represents the information that is being transferred by means of the string stream. Size is the number of bytes in the string, and Position is the current position within DataString.

Note: DataString is a read-only property. DataString can be used to change the contents of the string, but applications can’t change the DataString itself.

3、 The initialization section

The initialization section is optional. It begins with the reserved word initialization and continues until the beginning of the finalization section or, if there is no finalization section, until the end of the unit. The initialization section contains statements that are executed, in the order in which they appear, on program start-up. So, for example, if you have defined data structures that need to be initialized, you can do this in the initialization section.

The initialization sections of units used by a client are executed in the order in which the units appear in the client’s uses clause.

4、 TWinControl.DoubleBuffered

Determines whether the control’s image is rendered directly to the window or painted to an in-memory bitmap first.

property DoubleBuffered: Boolean;

Description

When DoubleBuffered is False, the windowed control paints itself directly to the window. When DoubleBuffered is True, the windowed control paints itself to an in-memory bitmap that is then used to paint the window. Double buffering reduces the amount of flicker when the control repaints, but is more memory intensive.

When a windowed control is a dock site and has an associated dock manager, it must be double-buffered.

Note: Some controls, such as TRichEdit, can’t paint themselves into a bitmap. For such controls, DoubleBuffered must be set to False.

5、 DecodeTime procedure

Breaks a TDateTime value into hours, minutes, seconds, and milliseconds.

Unit

SysUtils

Category

date/time routines

procedure DecodeTime(Time: TDateTime; var Hour, Min, Sec, MSec: Word);

Description

DecodeTime breaks the object specified as the Time parameter into hours, minutes, seconds, and milliseconds.

6、 Odd function

Returns True if argument is an odd number.

Unit

System

Category

ordinal routines

function Odd(X: Longint): Boolean;

Description

Odd tests if the argument is an odd number. It returns True if X is an odd number, False if X is even.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值