码农的笔记

Delphi虽好,但已不流行; 博客真好,可以做笔记

博客园 首页 新随笔 联系 订阅 管理

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.

 

posted on 2022-04-08 11:04  码农的笔记  阅读(70)  评论(0编辑  收藏  举报