if 'hello' in ['hello','world','god'] then  showmessage('i got it')
语法错

解决方案 »

  1.   

    可以这样试试
    type words=set of (hello,world,good);if hello in [hello,world,good] then
       ShowMessage('I got it');
      

  2.   

    type
      Vwords = (world,hello,good);procedure TForm1.Button1Click(Sender: TObject);
    begin
     if  vwords(ord(hello))=hello then
      ShowMessage('在里面');
    end;
      

  3.   

    var
     strs:TStringlist;
    begin
      strs:=TStringlist.create;
      strs.Delimiter:=',';
      strs.add('hello');
      strs.add('world');
      strs.add('god');
      //strs.commatext中的内容为'hello,world,god' ,剩下的不用我说了吧
    end;//记得用完之后 strs.Free;