Procedure PadFileName(StIn:String;Var StOut:String); Pads a file name to 12 characters. It makes the string look neater but under certain conditions the string is no longer treated as a file name because of the padding. Make sure the functions you use accept the string. PadFileName('MYFILE.DAT',StOut) = StOut:='MYFILE .DAT';