case只能是有序类型,集合也可以

解决方案 »

  1.   

    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;
      

  2.   

    Case 语句必须是常数、集合
      

  3.   

    begin
      case ComboBox1.ItemIndex of //只能是有序类型
        0: edit1.text:=combobox1.text;
        1: edit1.text:='nihao';
        2: edit1.text:='haha';
      end
    end;
      

  4.   

    集合不能吧
    var
      S: TSysCharSet;
    begin
      S := [1];
      case S of
        [1]: ;
      end;
      

  5.   

      case ComboBox3.items.Indexof(ComboBox3.Text) of
      0:begin     
    ...
      end.