Scott Clark mentioned this to All:
SC> How can I get around this? I get the feeling I should be in a
SC> loop just reading the file a line at a time and somehow using
SC> the StrPas function to convert it to a Pascal string before adding
SC> it to the StringList. But How?
What version of Delphi are you using? A loop, as you described, may be the
best way to go, but you shouldn't need to use StrPas. Use AssignFile, Reset,
Readln, and CloseFile to handle the file I/O.
Or, depending on the file size, read the entire file into a stream (for
example, an instance of TMemoryStream), manipulate the data to replace the
nulls, then use TStringList.LoadFromStream.
Or read the entire file into one big string (Delphi 2 & 3 only), manipulate
it, then put it into the string list with the TStringList.Text property.
...Gary
--- GoldED 2.41
---------------
* Origin: The Flying Circus BBS, Farmington Hills, MI. (1:2410/905)
|