home *** CD-ROM | disk | FTP | other *** search
- unit RPaU;
-
- interface
- function RPad( X: string; Lngth: integer): string;
-
- implementation
- function RPad;
- var Temp: string;
- I: integer;
- begin
- Temp := X;
- if ord(Temp[0]) <= Lngth then
- begin
- while ord(Temp[0]) < Lngth do Temp := ' ' + Temp;
- end
- else
- while ord(Temp[0]) > Lngth do
- begin
- dec(Temp[0]);
- move(Temp[2],Temp[1],ord(Temp[0]));
- end;
- RPad := copy(Temp,1,Lngth); (* this line is probably redundant *)
- end;
-
- end.
-