The System and SysUtils units declare many standard pointer types that are commonly used.
Pointer type
|
Points to variables of type
|
|
PAnsiString, PString |
AnsiString |
|
PByteArray |
TByteArray (declared in SysUtils). Used to typecast dynamically
allocated memory for array access. |
|
PCurrency, PDouble, PExtended, PSingle |
Currency, Double, Extended, Single |
|
PInteger |
Integer |
|
POleVariant |
OleVariant |
|
PShortString |
ShortString. Useful when porting legacy code that uses the old PString
type. |
|
PTextBuf |
TTextBuf
(declared in SysUtils). TTextBuf is the internal buffer type in
a TtextRec file record.) |
|
PVarRec |
TVarRec
(declared in System) |
|
PVariant |
Variant |
|
PWideString |
WideString |
|
PWordArray |
TWordArray
(declared in SysUtils). Used to typecast dynamically allocated memory
for arrays of 2-byte values. |
System单元和SysUtils单元声明了许多常用的标准指针类型。列表如下
指针类型
|
指向类型的变量
|
|
PAnsiString, PString |
AnsiString |
|
PByteArray |
TByteArray (声明于SysUtils),用于访问数组时动态转换分配内存。 |
|
PCurrency, PDouble, PExtended, PSingle |
Currency、Double、Extended、Single |
|
PInteger |
Integer |
|
POleVariant |
OleVariant |
|
PShortString |
ShortString,当使用旧的PString类型输入输出遗留下来的代码时有用。 |
|
PTextBuf |
TTextBuf (声明于SysUtils)。TTextBuf是TTextRec文件记录类型的内部缓冲类型。 |
|
PVarRec |
TVarRec(声明于System) |
|
PVariant |
Variant |
|
PWideString |
WideString |
|
PWordArray |
TWordArray
(声明于SysUtils)。用于双字节值动态转换分配内存。 |