[fpc-pascal]TStringList index

Taj Morton taj at wildgardenseed.com
Sun Mar 14 20:04:34 CET 2004


Hi all,
This code has been driving me nuts for the past week.
      IDs:=TStringList.Create;
      for i:=0 to Datab.List_Field.Count-1 do
      begin
	 Tmp:=TStringList(Datab.List_Field.items[i]);
	 IDs.Strings[i]:=Tmp.Strings[0];
	 Tmp.Free;
      end;

It crashes with 
An unhandled exception occurred at 0x08062FE5 :
ESTRINGLISTERROR : List index exceeds bounds (0)
  0x08062FE5

Datab.List_Field.Count-1=18. It appears that IDs is not letting me write to 
item i. Any ideas?
Thanks, Taj





More information about the fpc-pascal mailing list