?? uclasses.pas
字號:
unit uClasses;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TBase = class(TObject)
Public
Procedure VM1; virtual;
Procedure VM2; virtual;
Procedure VM3; virtual;
Procedure VM4; virtual;
Procedure VM5; virtual;
end;
TDerived1 = class(TBase)
Public
Procedure VM3; override;
procedure VM6; virtual;
end;
TDerived2 = class(TDerived1)
Public
Procedure VM6; override;
end;
TFoo = class(TObject)
class function MyName: String;
private
aField : Integer;
aStr : String;
public
procedure VM1; virtual;
procedure VM2; virtual;
procedure DM1; dynamic;
procedure DM2; dynamic;
procedure SetField(const iValue : Integer);
function getField : Integer;
procedure SetStr(const sStr : String);
function GetStr : String;
property Field : Integer read aField write aField;
end;
implementation
{ TBase }
procedure TBase.VM1;
begin
ShowMessage('TBase.VM1');
end;
procedure TBase.VM2;
begin
ShowMessage('TBase.VM2');
end;
procedure TBase.VM3;
begin
end;
procedure TBase.VM4;
begin
end;
procedure TBase.VM5;
begin
end;
{ TDerived }
procedure TDerived1.VM3;
begin
inherited;
end;
{ TDerived2 }
procedure TDerived1.VM6;
begin
inherited;
end;
procedure TDerived2.VM6;
begin
inherited;
end;
{ TFoo }
procedure TFoo.DM1;
begin
end;
procedure TFoo.DM2;
begin
end;
function TFoo.getField: Integer;
begin
Result := aField;
end;
function TFoo.GetStr: String;
begin
Result := aStr;
end;
class function TFoo.MyName: String;
begin
Result := 'TFoo';
end;
procedure TFoo.SetField(const iValue: Integer);
begin
aField := iValue;
end;
procedure TFoo.SetStr(const sStr : String);
begin
aStr := sStr;
end;
procedure TFoo.VM1;
begin
ShowMessage('VM1');
end;
procedure TFoo.VM2;
begin
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -