📄 unit1.pas
字号:
unit Unit1;interfaceuses SysUtils, Types, Classes, Variants, QGraphics, QControls, QForms, QDialogs, QStdCtrls;type{ TBase = class// protected
private
FB: Integer;
public
procedure SetBase( B: Integer );
function GetBase(): Integer;
end;
TDerived = class( TBase )// protected
private
FD: Integer;
public
procedure SetDerived( D: Integer ); overload;
procedure SetDerived( B, D: Integer ); overload;
function GetDerived(): Integer;
end;
} TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementationuses Base, Derived;
{$R *.xfm}procedure TForm1.Button1Click(Sender: TObject);var De: TDerived;
begin
De := TDerived.Create();
// De.FD := 100;
// De.FB := 100;
// De.SetBase( 100 );
De.SetDerived( 100 );
Button1.Caption := IntToStr( De.GetBase() );
end;end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -