home *** CD-ROM | disk | FTP | other *** search
- Program Test_Parser;
- Const
- MaxParse = 20;
- Type
- WrkString = String[80];
- ParseRange = 0 .. MaxParse;
- ParseType = RECORD
- Count : ParseRange;
- S : ARRAY[0 .. MaxParse] of WrkString;
- END;
-
- Var
- SepStr, S : WrkString;
- P : ParseType;
- i : integer;
- tokens : integer;
-
- {$I PARSER.LIB}
-
- BEGIN
- CLrScr;
- SepStr := ' ,';
- Writeln(' enter a string ');
- Readln(S);
- tokens := Parse_Str(SepStr,S,P);
- Writeln(' there are ',tokens,' tokens, which are :');
- for i := 0 to tokens-1 do
- Writeln(' ',i+1,' "',P.s[i],'"');
- END.