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.

你可能感兴趣的:(Delphi)