1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
| unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons;
type
TForm1 = class(TForm)
SpeedButton1: TSpeedButton;
procedure SpeedButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
C1 = class
procedure non();
function oui():integer;
end;
C2 = class(C1)
procedure non(rep : string);
function oui():integer;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
{ C1 }
procedure C1.non();
begin
showmessage('Non');
end;
function C1.oui(): integer;
begin
showmessage('Oui');
result := 33;
end;
{ C2 }
procedure C2.non(rep : string);
begin
inherited non();
end;
function C2.oui(): integer;
begin
inherited oui();
result := 33;
end;
procedure TForm1.SpeedButton1Click(Sender: TObject);
var
C : C2;
begin
C := C2.Create();
C.oui();
C.Free();
end;
end. |
Partager