请给出tstrings类中的IndexOfName方法程序实例。IndexOfName此方法是什么意思??
解决方案 »
- 那个啥,叫DirectUI的,delphi不是很早就有了这种做法了吗?
- ShellExecute返回错误值,为什么GetLastError返回0
- 动态创建的控件的事件问题?
- 哪为位子高手帮我看看 我想对两个目标盘的文件进行查找比较!我的问题是TmemoryStream和Tstring如何相互间使用出现错误!我的问题在注释的
- FastReport横向打印的奇怪问题,请大家看看
- 请问如何删除从数据库读取的DBGrid的选种内容阿?
- Delphi/Pascal中有break,continue和return语句吗?
- 在一个Unit里如何指定一个ClientSocket的OnError和OnConnect的事件?
- 这样的查询语句该怎样写
- 谁能告诉我DBISAM控件怎样创建数据库,来者有分!
- 如何在WinXP\2000\Me\98获得特殊文件夹的路径(Program Files,System,Windows...)?谢谢^-^
- 关于GetVersionEx在WinXP下的返回值
var
tmplist:TStringList;
begin
tmplist:=TStringList.Create ;
tmplist.Add('a1=b1');
tmplist.Add('a2=b2');
showmessage(inttostr(tmplist.IndexOfName('a1')));
showmessage(inttostr(tmplist.IndexOfName('a2')));
tmplist.Free ;
//此方法多用于操作INI文件等;
end;
I, DI: Integer;
begin
for I := 0 to Source.Count - 1 do
begin
if Pos ('=', Source[I]) > 1 then
begin
DI := Dest.IndexOfName(Source.Names[I]);
if DI > -1 then Dest[DI] := Source[I];
end;
end;
end;procedure TForm1.Button1Click(Sender: TObject);
begin
MergeStrings(ListBox1.Items,ListBox2.Items);
end;
var
P: Integer;
S: string;
begin
for Result := 0 to GetCount - 1 do
begin
S := Get(Result);
P := AnsiPos('=', S);
if (P <> 0) and (CompareStrings(Copy(S, 1, P - 1), Name) = 0) then Exit;
end;
Result := -1;
end;