home *** CD-ROM | disk | FTP | other *** search
- function FormStr(Picture : string;
- S : string) : string;
-
- const StrFieldSet : set of char = ['#','@'];
-
- var FieldStr : string;
- Position,
- I,K : word;
-
- begin
- Position:=1; {Ignore stand alone '.' and ','}
- while ((not (Picture[Position] in StrFieldSet))
- and (Position <= length(Picture))) do
- inc(Position);
- if (Position > length(Picture)) then
- begin
- Position:=0;
- FieldStr:='';
- end
- else
- begin
- I:=Position;
- while (Picture[I] in StrFieldSet)
- and (I<=length(Picture)) do
- inc(I);
- FieldStr:= copy(Picture,Position,I-Position);
- end;
- if (pos('@',FieldStr)<>0) then
- while (length(S) < length(FieldStr)) do
- S:=' '+S
- else
- while (length(S) < length(FieldStr)) do
- S:=S+' ';
- for I:=1 to length(FieldStr) do
- Picture[Position+I-1]:=S[I];
- FormStr:=Picture;
- end;