Since it is comma separator data, use TStringList to parse as follow:

var St: TStringList;
    i: integer;

begin
  St:= TStringList.Create;
  Try
    St.CommaText:= '00,INITIAL,NOP, 000000, 000000,04,INC,GTF,MTF,ATF.';
    for i:=0 to St.Count-1 do
      // now the substring is in (for strings :St[i] , and for numbers
:IntToStr(St[i] )
  Finally
    St.Free;
  end;
end;


Monir

-----Original Message-----
Sent: Thursday, October 23, 2008 5:16 AM
To: 'Borland's Delphi Discussion List'
Subject: Parsing strings.

Short of doing the usual substring etc. and breaking the string below into
smaller ones and then using val() to grab the numbers is there something
equivalent to sscanf() in Delphi? 

'00,INITIAL,NOP, 000000, 000000,04,INC,GTF,MTF,ATF.'

Thanks

John

Automation Artisans Inc.
http://www.autoartisans.com/ELS/
Ph. 1 250 544 4950


_______________________________________________
Delphi mailing list -> Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


_______________________________________________
Delphi mailing list -> Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

Reply via email to