TStringList... Var sl:TStringlist;begin SL:=TStringlist.Create(); ..... ..... SL.Free;end; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我可以将它附给Tlistview吗,怎么用 晕,不能tstringlist类似于一个字符串数组 在class.pas里的定义: TStringList = class(TStrings) private FList: PStringItemList; FCount: Integer; FCapacity: Integer; FSorted: Boolean; FDuplicates: TDuplicates; FOnChange: TNotifyEvent; FOnChanging: TNotifyEvent; procedure ExchangeItems(Index1, Index2: Integer); procedure Grow; procedure QuickSort(L, R: Integer; SCompare: TStringListSortCompare); procedure InsertItem(Index: Integer; const S: string); procedure SetSorted(Value: Boolean); protected procedure Changed; virtual; procedure Changing; virtual; function Get(Index: Integer): string; override; function GetCapacity: Integer; override; function GetCount: Integer; override; function GetObject(Index: Integer): TObject; override; procedure Put(Index: Integer; const S: string); override; procedure PutObject(Index: Integer; AObject: TObject); override; procedure SetCapacity(NewCapacity: Integer); override; procedure SetUpdateState(Updating: Boolean); override; public destructor Destroy; override; function Add(const S: string): Integer; override; procedure Clear; override; procedure Delete(Index: Integer); override; procedure Exchange(Index1, Index2: Integer); override; function Find(const S: string; var Index: Integer): Boolean; virtual; function IndexOf(const S: string): Integer; override; procedure Insert(Index: Integer; const S: string); override; procedure Sort; virtual; procedure CustomSort(Compare: TStringListSortCompare); virtual; property Duplicates: TDuplicates read FDuplicates write FDuplicates; property Sorted: Boolean read FSorted write SetSorted; property OnChange: TNotifyEvent read FOnChange write FOnChange; property OnChanging: TNotifyEvent read FOnChanging write FOnChanging; end; 它是一个字符列表类。 tobject --tstring-tstringlist 那我怎么显示 tstringlist 里的内容 var i:Integer;begin for i:=0 to StringList.Count-1 do ShowMessage(StringList[i]);end; delphi 函数WindowProc是什么 有什么作用 如何使用? 请问能把DLL中的一个类导出吗?然后在另一个delphi应用程序中使用该类创建对象。 投拆C++Builder版主ccrun(老妖),我提一个问,就被骂成这个样子,CSDN上都是这样的人啊 如何编写一个能够被窗体自动调用的vcl组件? 请教怎么快速把一个单元的所有编辑框初始化为空 請問大俠如何判定自已電腦是否連在InterNet 上? 进者有分。:) 请问delphi中调用的算法怎么改名? pagecontrol 是什么东东?在那个页下? 怎样取得当前计算机的名称?急用 很迷茫 想要判断dblistbox 中是否还有内容?
tstringlist类似于一个字符串数组
TStringList = class(TStrings)
private
FList: PStringItemList;
FCount: Integer;
FCapacity: Integer;
FSorted: Boolean;
FDuplicates: TDuplicates;
FOnChange: TNotifyEvent;
FOnChanging: TNotifyEvent;
procedure ExchangeItems(Index1, Index2: Integer);
procedure Grow;
procedure QuickSort(L, R: Integer; SCompare: TStringListSortCompare);
procedure InsertItem(Index: Integer; const S: string);
procedure SetSorted(Value: Boolean);
protected
procedure Changed; virtual;
procedure Changing; virtual;
function Get(Index: Integer): string; override;
function GetCapacity: Integer; override;
function GetCount: Integer; override;
function GetObject(Index: Integer): TObject; override;
procedure Put(Index: Integer; const S: string); override;
procedure PutObject(Index: Integer; AObject: TObject); override;
procedure SetCapacity(NewCapacity: Integer); override;
procedure SetUpdateState(Updating: Boolean); override;
public
destructor Destroy; override;
function Add(const S: string): Integer; override;
procedure Clear; override;
procedure Delete(Index: Integer); override;
procedure Exchange(Index1, Index2: Integer); override;
function Find(const S: string; var Index: Integer): Boolean; virtual;
function IndexOf(const S: string): Integer; override;
procedure Insert(Index: Integer; const S: string); override;
procedure Sort; virtual;
procedure CustomSort(Compare: TStringListSortCompare); virtual;
property Duplicates: TDuplicates read FDuplicates write FDuplicates;
property Sorted: Boolean read FSorted write SetSorted;
property OnChange: TNotifyEvent read FOnChange write FOnChange;
property OnChanging: TNotifyEvent read FOnChanging write FOnChanging;
end;
tobject --tstring-tstringlist
i:Integer;
begin
for i:=0 to StringList.Count-1 do
ShowMessage(StringList[i]);
end;