[fpc-pascal] How to split file of whitespace separated numbers?

Gabor Boros gaborboros at yahoo.com
Fri Dec 23 10:04:09 CET 2016


2016. 12. 23. 9:14 keltezéssel, Bo Berglund írta:
> Is there a quick way to split a string of whitespace separated values
> into the separate members?

Hi,

I don't know quick or not...

program Project1;

uses Classes;

var
   SL:TStringList;
   i:Integer;

begin
   SL:=TStringList.Create;
   SL.DelimitedText:='   0.000    0.000    7.000    0.000  29.6628';
   for i:=0 to SL.Count-1 do
    begin
      WriteLn('*'+SL.Strings[i]+'*');
    end;
   ReadLn;
end.

Gabor


More information about the fpc-pascal mailing list