主题:有关集合的问题
小弟我看不太明白这些代码;希望高手给做些注解~`[em1]
interface//定义全局变量
var
form1: tform1;
dlgtype:array [0..4] of TMsgDlgType=(mtwarning,mtError,mtInformation,mtconfitmation,mtcustom);
buttons:set of TMsgDlgBtn=[];
~~~~~~~~~~
procedure TForm1.SpeedButton1Click(Sender: TObject);//这是按键程序
var value:integer;
begin
if checkbox1.checked then buttons:=buttons + [mbOK]
else buttons:=buttons - [mbOK];
if checkbox2.checked then buttons:=buttons + [mbCamcel]
else buttons:=buttons - [mbCamcel];
if checkbox3.checked then buttons:=buttons + [mbAbort]
else buttons:=buttons - [mbAbort];
if checkbox4.checked then buttons:=buttons + [mbRetry]
else buttons:=buttons - [mbretry];
if checkbox5.checked then buttons:=buttons + [mbignore]
else buttons:=buttons - [mbigonre];
if checkbox6.checked then buttons:=buttons + [mbYes]
else buttons:=buttons - [mbYes];
if checkbox7.checked then buttons:=buttons + [mbNO]
else buttons:=buttons - [mbNo];
if checkbox8.checked then buttons:=buttons + [mbYestoall]
else buttons:=buttons - [mbyestoall];
if checkbox9.checked then buttons:=buttons + [mbnotoall]
else buttons:=buttons - [mbnotoall];
if checkbox10.checked then buttons:=buttons + [mbYestoall]
else buttons:=buttons - [mbYestoall];
if checkbox11.checked then buttons:=buttons + [mbhelp]
else buttons:=buttons - [mbhelp];
value:Messagedlg(memo1.Text,slgtype[radioGroup1.itemindex],buttons,0);
showmessage('返回值是: '+inttostr(value);
大家给我留点注解 呵呵
[em8]
interface//定义全局变量
var
form1: tform1;
dlgtype:array [0..4] of TMsgDlgType=(mtwarning,mtError,mtInformation,mtconfitmation,mtcustom);
buttons:set of TMsgDlgBtn=[];
~~~~~~~~~~
procedure TForm1.SpeedButton1Click(Sender: TObject);//这是按键程序
var value:integer;
begin
if checkbox1.checked then buttons:=buttons + [mbOK]
else buttons:=buttons - [mbOK];
if checkbox2.checked then buttons:=buttons + [mbCamcel]
else buttons:=buttons - [mbCamcel];
if checkbox3.checked then buttons:=buttons + [mbAbort]
else buttons:=buttons - [mbAbort];
if checkbox4.checked then buttons:=buttons + [mbRetry]
else buttons:=buttons - [mbretry];
if checkbox5.checked then buttons:=buttons + [mbignore]
else buttons:=buttons - [mbigonre];
if checkbox6.checked then buttons:=buttons + [mbYes]
else buttons:=buttons - [mbYes];
if checkbox7.checked then buttons:=buttons + [mbNO]
else buttons:=buttons - [mbNo];
if checkbox8.checked then buttons:=buttons + [mbYestoall]
else buttons:=buttons - [mbyestoall];
if checkbox9.checked then buttons:=buttons + [mbnotoall]
else buttons:=buttons - [mbnotoall];
if checkbox10.checked then buttons:=buttons + [mbYestoall]
else buttons:=buttons - [mbYestoall];
if checkbox11.checked then buttons:=buttons + [mbhelp]
else buttons:=buttons - [mbhelp];
value:Messagedlg(memo1.Text,slgtype[radioGroup1.itemindex],buttons,0);
showmessage('返回值是: '+inttostr(value);
大家给我留点注解 呵呵
[em8]