var
  vilelist:TstringList;
filelist.Add(edit1.text);//程序总是到这里就会卡住
不过我实在是不知stringlist的用法,请帮忙列出它的常用方法及其它,如怎样增加进去,怎样弄出来
小弟是菜鸟,请高手见了不要笑话我!

解决方案 »

  1.   

    不好意思上面字打错了
    var
      filelist:TstringList;
    filelist.Add(edit1.text
      

  2.   

    这是DELPHI里的帮助的例子:
    procedure TForm1.FormCreate(Sender: TObject);var
      MyList: TStringList;
      Index: Integer;
    begin
      MyList := TStringList.Create;
      try
        MyList.Add('Animals');
        MyList.Add('Flowers');    MyList.Add('Cars');    MyList.Sort;   { Find will only work on sorted lists! }
        if MyList.Find('Flowers', Index) then
        begin
          ListBox1.Items.AddStrings(MyList);
          Label1.Caption := 'Flowers has an index value of ' + IntToStr(Index);
        end;
      finally
        MyList.Free;
      end;
    end;
      

  3.   

    vilelist := TStringList.Create;...vilelist.Add('aaa');
    vilelist.Add('bbb');
    ...ShowMessage(vilelist[0]);
      

  4.   

    你是不是少了
    MyList := TStringList.Create;
    这句呀?
      

  5.   

    我是这样用的
    var strs:tstrings;strs:=tstringlist.create;
    strs.add(edit1.text);
      

  6.   

    没有生成对象实例怎么可以呢?
    可以这样做;with TStringList.Create do
    try
      Add('ssdsds');
    finally
      Close;
    end;
      

  7.   

    错了:)with TStringList.Create do
    try
      Add('ssdsds');
    finally
      Free;
    end;