在声明类等时,"T" TObject代表什么?模板?
例:
procedure TfrmMain.CaptureInfo1Click(Sender: TObject);
begin
frmCapture.Show;
end;
Run Code Online (Sandbox Code Playgroud)
德尔福有许多官方批准的前缀.
这些都是Borland惯例,并不是由编译器强制执行的.
Prefix | Used for | Notes
-------+----------+---------------------------------------------
T | types | Denotes a structured type, class or record
I |interfaces| For interfaces, e.g. IInterface
F | Field | Private Field in a class or record
xx | enum | Enumeration members have a 2 char prefix
| | e.g. fsBold, fsItalic for the TFontStyle enum
A | params | deprecated ! All method params at one point started with an `A`.
this convention is no longer encouraged.
Note that the capitalization is as shown.
Delphi使用前缀的原因是该语言不区分大小写,因此使用ALLCAPS作为常量和类型的前导上限的C/Java技巧不起作用.
Object Pascal样式指南中概述了所有这些以及更多内容,更具体地说,是命名约定部分.
这是Borland等人编写的所有源代码遵循的风格
| 归档时间: |
|
| 查看次数: |
743 次 |
| 最近记录: |