<pre>function pad howMany  if howMany is 0 then return empty  repeat howMany times    put "_" after string  end repeat  return stringend padfunction pad T,N,F  if F is empty then put space into F  put the length of T into L  if L >= N then get char 1 to N of T  else    get T    repeat with i = L to (N-1)      put F after it    end repeat  end if  return itend pad</pre>