The RightPad function returns the string S, right-justified within the output, and padded with the Ch character (on the left) if necessary, to make the output up to length of Len.

Declaration: Function RightPad( S : string; Ch : Char; Len : Integer) : string;

Here are a few examples.

procedure OnMapEvent(var Value:Variant);
var
Str1, Str2, Str3, Str4 : string;
begin
Str1 := RightPad('abc','1',5); // returns '11abc' - two padding characters added, leaving S right-justified
Str2 := RightPad('abcdef','1',10); // returns '1111abcdef' - four padding characters added
Str3 := RightPad('abc','1',2); // returns 'abc' - no padding necessary (and no truncation)
Str4 := RightPad('This is a test','*',20); // returns '******This is a test' - 6 padding characters added
end;