up previous next
format

convert object to formatted string

Syntax
format(E: OBJECT, N: INT): STRING

Description
Like Sprint, this function converts the value of E into a string. If the string has fewer than N characters, then spaces are added to the front to make the length N.

Example
/**/  L := [5^n | n In 0..7];
/**/  Foreach F In L Do print Format(F,8); EndForeach;
       1       5      25     125     625    3125   15625   78125

/**/  M := Format(L,20);
/**/  M;  -- "Format" does not truncate
[1, 5, 25, 125, 625, 3125, 15625, 78125]
/**/  type(L);
LIST
/**/  type(M);
STRING

See Also