classexplorerdemo_classes.pas
来自「source code for the Marco Cantu s book D」· PAS 代码 · 共 59 行
PAS
59 行
unit ClassExplorerDemo_Classes;
interface
type
TBaseClass = class
private
FSomeData: Integer;
procedure SetSomeData(const Value: Integer);
public
property SomeData: Integer read FSomeData write SetSomeData;
strict private
function GetAnotherInteger : Integer;
procedure SetAnotherInteger(val : Integer);
public
property AnotherInteger : Integer read GetAnotherInteger write SetAnotherInteger;
strict private
var
FAnotherInteger:Integer;
end;
TDerivedClass = class (TBaseClass)
private
FSomeText: string;
procedure SetSomeText(const Value: string);
public
property SomeText: string read FSomeText write SetSomeText;
end;
implementation
{ TBaseClass }
procedure TBaseClass.SetSomeData(const Value: Integer);
begin
FSomeData := Value;
end;
{ TDerivedClass }
procedure TDerivedClass.SetSomeText(const Value: string);
begin
FSomeText := Value;
end;
function TBaseClass.GetAnotherInteger: Integer;
begin
result := FAnotherInteger;
end;
procedure TBaseClass.SetAnotherInteger(val : Integer);
begin
FAnotherInteger := val;
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?