GetPadString is now one line long, so we should eliminate it
$NextOut = sprintf("%05d", FindLastOut('.') + 1);
Total savings: 15 lines and two global variables