strPadC fix

This commit is contained in:
mysticbbs 2013-04-22 13:35:06 -04:00
parent 6dc66831f6
commit 35f46bbc16
1 changed files with 7 additions and 0 deletions

View File

@ -53,6 +53,13 @@ Var
Space : Byte;
Temp : Byte;
Begin
If Length(Str) > Len Then Begin
Str[0] := Chr(Len);
Result := Str;
Exit;
End;
Space := (Len - Length(Str)) DIV 2;
Temp := Len - ((Space * 2) + Length(Str));
Result := strRep(Ch, Space) + Str + strRep(Ch, Space + Temp);