Board index » delphi » What is wrong with the TStringList LoadFromFile?

What is wrong with the TStringList LoadFromFile?

If I try loading a certain few files using the LoadFromFile from a
TStringList object, it crashed and says "List out of bounds". Yet If I
first load it into a TMemo object using the LoadFromFile then copy it
into the TStringList using the Assign(Memo1), it works fine - so it
can't be low resources!

What gives? I am an experienced Delphi user and I can't figure this
one out.

BTW: the file is a Rich Text Format (RTF) document. Some RTF documents
work fine.

Colin MacKenzie
Silicon Electronics
Metro Halifax, Nova Scotia, Canada
(902) 864-3982

 

Re:What is wrong with the TStringList LoadFromFile?


On Tue, 23 Jul 1996 22:01:01 GMT, cmacken...@mail.ips.ca (Colin

Quote
MacKenzie) wrote:
>TStringList object, it crashed and says "List out of bounds". Yet If I
>first load it into a TMemo object using the LoadFromFile then copy it
>into the TStringList using the Assign(Memo1), it works fine - so it
>can't be low resources!

Which version of Delphi? There is a bug in Delphi 1, where TStringList
cannot read a file that contains a zero byte. It goes into an infinite
loop, adding empty strings until the list fills. You might be running
into that problem.

--
Ray Lischner                              li...@tempest-sw.com
Tempest Software, Corvallis, Oregon, USA  http://www.tempest-sw.com

Other Threads