procedure TForm1.Button1Click(Sender: TObject);
begin
if option1.Checked=true then
begin
application.MessageBox(pchar('a'),'title',68);
end
else
begin
application.MessageBox(pchar('b'),'title',68);
end
end;
begin
if option1.Checked=true then
begin
application.MessageBox(pchar('a'),'title',68);
end
else
begin
application.MessageBox(pchar('b'),'title',68);
end
end;
begin
if option1.Checked=true then
begin
application.MessageBox(PAnsiChar(String('a')),'title',68);
end
else
begin
application.MessageBox(PAnsiChar(String('b')),'title',68);
end
end;orprocedure TForm1.Button1Click(Sender: TObject);
var
s:string;
begin
if option1.Checked=true then
s:='a'
else
s:='b';application.MessageBox(PAnsiChar(s),'title',68);
end;
if option1.Checked=true then
这样写,直接if option1.Checked then不就是了.感觉加个很别扭.