Board index » delphi » Error with TStringList.LoadFromFile and nulls

Error with TStringList.LoadFromFile and nulls

If a file to be loaded with TStringList.LoadFromFile has a null at the
end of file, the LoadFromFile operation fails. I discovered this after
using the replacement text editor provided with my SoundBlaster AWE
sound card. (This editor 'speaks' the file, and also sticks a null on
the end.)

From a debugging session, it would appear that the end of file is not
detected and blank lines are appended to the list until the total
number of lines is too large (16K).

--
Chris Isbell
Southampton, England
ch...@isbell.demon.co.uk
+44 1703 465367

 

Re:Error with TStringList.LoadFromFile and nulls


Quote
ch...@isbell.demon.co.uk (Chris Isbell) wrote:
>If a file to be loaded with TStringList.LoadFromFile has a null at the
>end of file, the LoadFromFile operation fails. I discovered this after
>using the replacement text editor provided with my SoundBlaster AWE
>sound card. (This editor 'speaks' the file, and also sticks a null on
>the end.)

>From a debugging session, it would appear that the end of file is not
>detected and blank lines are appended to the list until the total
>number of lines is too large (16K).

Interesting.  I verified this and submitted it to our QA dept.  Thanks for finding it.

     -Steve Teixeira
      steix...@borland.com

Other Threads