📄 bases.pas
字号:
unit Bases;interfaceuses SysUtils, Classes, Types, QGraphics;type TA = class( TObject )
public
FA: Integer;
public
function Do1(): Integer;
end;
TB = class( TA )
// protected
public
FB: Integer;
public
function Do2(): Integer;
function Do1(): Integer; // Declare this, get chap1102.bmp
// The Reserved word, overload, has no any effects to Do1.
end;
TC = class( TB )
// protected
public
FC: Integer;
public
function Do3(): Integer; overload;
end;
var
A: TA; B: TB; pm, pn: function (): Integer of object;
implementation
{ TA }function TA.Do1(): Integer;begin // This gets the address Self points to, i.e., the object per se. Result := Integer( Pointer( Self ) ); // if use // Result := Integer( @Self ); // we will get the the address of Self per se.end;{ TB }function TB.Do1: Integer;begin Result := Inherited Do1;end;function TB.Do2(): Integer;begin Result := Integer( Pointer( Self ) );end;{ TC }function TC.Do3(): Integer;begin Result := Integer( Pointer( Self ) );end;end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -