D7
1 unit Unit1; 2 3 interface 4 5 uses 6 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 7 Dialogs, StdCtrls; 8 9 type 10 TForm1 = class(TForm) 11 Button1: TButton; 12 Button2: TButton; 13 Button3: TButton; 14 procedure Button1Click(Sender: TObject); 15 procedure Button2Click(Sender: TObject); 16 procedure Button3Click(Sender: TObject); 17 private 18 { Private declarations } 19 public 20 { Public declarations } 21 end; 22 TMyset001=set of (ss,aa,mm,tt); 23 var 24 Form1: TForm1; 25 Set01:TMyset001; 26 implementation 27 28 {$R *.dfm} 29 30 procedure TForm1.Button1Click(Sender: TObject); 31 begin 32 Include(Set01,aa); 33 end; 34 35 procedure TForm1.Button2Click(Sender: TObject); 36 begin 37 Include(Set01,ss); 38 39 end; 40 41 procedure TForm1.Button3Click(Sender: TObject); 42 begin 43 Exclude(Set01,ss); 44 Exclude(Set01,aa); 45 Exclude(Set01,ss); 46 if Set01=[] then 47 begin 48 // 49 end; 50 end; 51 52 end.