home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
bbs_mail
/
mpi100.arj
/
PARSE.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-03-18
|
794b
|
37 lines
unit Parse;
interface
var
EndTerm : integer;
Term : array[1..64] of string;
procedure Parseln(Line:string);
implementation
procedure Parseln(Line:string);
var
Marker : integer;
Extra : integer;
begin
while Pos(#9,Line)>0 do Line[Pos(#9,Line)] := #32;
while Line[1] = #32 do Delete(Line,1,1);
while Line[Length(Line)] = #32 do Dec(Line[0]);
if Line <> '' then
begin
EndTerm := 0;
while Pos(#32,Line)>0 do
begin
Extra := 0;
Inc(EndTerm);
Marker := Pos(#32,Line);
while Line[Marker+Extra] = #32 do Inc(Extra);
Term[EndTerm] := Copy(Line,1,Marker-1);
Delete(Line,1,Marker+(Extra-1));
end;
Inc(EndTerm);
Term[EndTerm] := Line;
end;
end;
end.