[fpc-pascal] TStringList.DelimitedText seems not to work...
bo.berglund at gmail.com
Mon Nov 19 22:09:02 CET 2018
FPC 3.0.4 with Lazarus 1.8.0 on Windows 7 x64
I am trying to use TStringList containers for parsing out values of
this kind for sending to a database handler script:
(<TAB> = #9)
I am using this construct, where Data holds the values in the format
Parse := TStringList.Create;
Parse.Delimiter := #9;
Parse.DelimitedText := Data; //Expected to split to 4 values
p := Parse.Count;
if p < 4 then //p is actually 5 here!
readtime := Parse; //This only gets the date part
source := Parse; //And the time winds up here!
temp := Parse;
humid := Parse;
Result := AddReading(readtime, source, temp, humid);
So what happens here is that DelimitedText actually splits the string
on #9 AND <whitespace>!!!!
How can I stop it from parsing using space, I thought taht whan I
defined it to be <TAB> (#9) that would be what it should use....
(I think it has been mentioned here in the last year, but I cannot
Developer in Sweden
More information about the fpc-pascal