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
|
unit Uni1;
interface
type
TCategorie = class;
TPersonne = class(TObject)
private
FCategorie: TCategorie;
FValeur : string;
public
constructor Create;
destructor Destroy; override;
property Valeur: string Read FValeur Write FValeur;
end;
//Catégories de personnes
TCatPersonne = (catégorie1, catégorie2, catégorie3, catégorie4);
TCategorie = class(TObject)
private
FCategorie: TCatPersonne;
public
constructor Create;
property Categorie: TCatPersonne read FCategorie;
end;
implementation
{ Personne }
constructor TPersonne.Create;
begin
inherited Create;
{test bien placé??}
if self.Valeur = 'AAA'
then ...
if self.Valeur = 'BBB'
then ...
if self.Valeur = 'CCC'
then...
end;
destructor TPersonne.Destroy;
begin
inherited Destroy;
end;
{ Categorie }
constructor TCategorie.Create;
begin
inherited Create;
end;
end. |
Partager