begin case Pos('.' + combobox1.text '.', '.hello.nihao.hah.') of //只能是有序类型 //12345678901234567 01: edit1.text:=combobox1.text; 07: edit1.text:='nihao'; 13: edit1.text:='haha'; end end;
Case 语句必须是常数、集合
begin case ComboBox1.ItemIndex of //只能是有序类型 0: edit1.text:=combobox1.text; 1: edit1.text:='nihao'; 2: edit1.text:='haha'; end end;
集合不能吧 var S: TSysCharSet; begin S := [1]; case S of [1]: ; end;
case ComboBox3.items.Indexof(ComboBox3.Text) of 0:begin ... end.
case Pos('.' + combobox1.text '.', '.hello.nihao.hah.') of //只能是有序类型
//12345678901234567
01: edit1.text:=combobox1.text;
07: edit1.text:='nihao';
13: edit1.text:='haha';
end
end;
case ComboBox1.ItemIndex of //只能是有序类型
0: edit1.text:=combobox1.text;
1: edit1.text:='nihao';
2: edit1.text:='haha';
end
end;
var
S: TSysCharSet;
begin
S := [1];
case S of
[1]: ;
end;
0:begin
...
end.