This statement (in Delphi 7)
writeln(logfile,format('%16.16d ',[FileInfo.size])+full_name);
results in this output
0000000021239384 C:\DATA\DELPHI\sxf_archive10-13.zip
This statement
writeln(logfile,format('%17.17d ',[FileInfo.size])+full_name);
results in this output
21239384 C:\DATA\DELPHI\sxf_archive10-13.zip
The padding with leading zeros changes to leading spaces when the precision specifier is larger than 16. The help says "If the format string contains a precision specifier, it indicates that the resulting string must contain at least the specified number of digits; if the value has less digits, the resulting string is left-padded with zeros."
Is there another way to format a 20 character integer with leading zeros?