Some formatting fixes
This commit is contained in:
parent
a8c63d1f5a
commit
00f3dfe30c
@ -7,9 +7,9 @@ interface
|
|||||||
uses Dialogs;
|
uses Dialogs;
|
||||||
|
|
||||||
type
|
type
|
||||||
TPerson = class
|
TPerson = class
|
||||||
procedure Speak; virtual; abstract;
|
procedure Speak; virtual; abstract;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{TBeckham}
|
{TBeckham}
|
||||||
TBeckham = class(TPerson)
|
TBeckham = class(TPerson)
|
||||||
|
@ -10,7 +10,7 @@ uses
|
|||||||
type
|
type
|
||||||
|
|
||||||
{ TMainform }
|
{ TMainform }
|
||||||
TMainform = class(TForm)
|
TMainform = class(TForm)
|
||||||
rgPeople: TRadioGroup;
|
rgPeople: TRadioGroup;
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure rgPeopleClick(Sender: TObject);
|
procedure rgPeopleClick(Sender: TObject);
|
||||||
@ -33,18 +33,18 @@ end;
|
|||||||
procedure TMainform.rgPeopleClick(Sender: TObject);
|
procedure TMainform.rgPeopleClick(Sender: TObject);
|
||||||
var p: TPerson;
|
var p: TPerson;
|
||||||
begin
|
begin
|
||||||
if rgPeople.ItemIndex < 0 then Exit;
|
if rgPeople.ItemIndex < 0 then Exit;
|
||||||
|
|
||||||
// Select the appropriate Person
|
// Select the appropriate Person
|
||||||
case rgPeople.ItemIndex of
|
case rgPeople.ItemIndex of
|
||||||
0: p := TBeckham.Create;
|
0: p := TBeckham.Create;
|
||||||
1: p := TShakespeare.Create;
|
1: p := TShakespeare.Create;
|
||||||
2: p := TWest.Create;
|
2: p := TWest.Create;
|
||||||
3: p := TBlaise.Create;
|
3: p := TBlaise.Create;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
p.Speak;
|
p.Speak;
|
||||||
p.Free;
|
p.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user