procedure TForm1.Button1Click(Sender: TObject);
var
str1:string;
str2:string;
str3:string;
begin
str1:=edit1.Text;
str2:=edit2.Text;
if combobox1.items:='加' then
begin
str3:=str1+str2 ;
end;
提示then后面报错, 为什么啊?
var
str1:string;
str2:string;
str3:string;
begin
str1:=edit1.Text;
str2:=edit2.Text;
if combobox1.items:='加' then
begin
str3:=str1+str2 ;
end;
提示then后面报错, 为什么啊?
改
if combobox1.items ='加' then
改成
if combobox1.items.Strings[0]:='加' then
改为 if combobox1.text='加' then
if combobox1.text='加' then
这样就可以了,但是为什么啊?combobox1.item 为什么不行呢? 再说 combobox里面也没有text这个属性啊还有 := 跟 = 有什么区别啊?谢谢上面的三外解答!
:=是赋值,=是判断