⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uclasses.pas

📁 多数代码可以直接在Delphi6和Delphi7环境下运行。部分涉及.NET技术内容的代码
💻 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 + -