mortezakiaee
پنج شنبه 23 آبان 1387, 11:11 صبح
کسی میتونه در مورد initialize کردن متغیر ها توضیح بده؟ راهنمای دلفی برای من زیاد مفهوم نبود
Initializes a dynamically allocated variable.
Unit
System
Category
dynamic allocation routines
Delphi syntax:
procedure Initialize(var V [ ; Count: Integer ] );
Description
Initialize should be used only in Delphi code where a variable is dynamically allocated by other means than the New standard procedure.
For global variables, local variables, objects, and dynamic variables allocated using New, the compiler generates code that initializes all long strings and variants contained by a variable upon creation of the variable. A call to Initialize is required to initialize a variable before it can be used if
The dynamic variable is created by other means than the New standard function (for example using GetMem or ReallocMem).
The variable contains long strings, variants, or interfaces.
The memory allocated for the variable is not initialized to zeros.
Initialize simply zeros out the memory occupied by long strings, variants, and interfaces, causing long strings to be empty and variants and interfaces to be Unassigned.
In cases where several variables are allocated in a contiguous memory block, the additional Count parameter can be specified to initialize all variables in one operation.
If the variable specified in a call to Initialize contains no long strings, variants, or interfaces, the compiler eliminates the call and generates no code for it.
Initializes a dynamically allocated variable.
Unit
System
Category
dynamic allocation routines
Delphi syntax:
procedure Initialize(var V [ ; Count: Integer ] );
Description
Initialize should be used only in Delphi code where a variable is dynamically allocated by other means than the New standard procedure.
For global variables, local variables, objects, and dynamic variables allocated using New, the compiler generates code that initializes all long strings and variants contained by a variable upon creation of the variable. A call to Initialize is required to initialize a variable before it can be used if
The dynamic variable is created by other means than the New standard function (for example using GetMem or ReallocMem).
The variable contains long strings, variants, or interfaces.
The memory allocated for the variable is not initialized to zeros.
Initialize simply zeros out the memory occupied by long strings, variants, and interfaces, causing long strings to be empty and variants and interfaces to be Unassigned.
In cases where several variables are allocated in a contiguous memory block, the additional Count parameter can be specified to initialize all variables in one operation.
If the variable specified in a call to Initialize contains no long strings, variants, or interfaces, the compiler eliminates the call and generates no code for it.