Here's a handy reusable function.
#CONSTANT PAD_RIGHT = 1
#CONSTANT PAD_LEFT = 2
print pad$("12","0",4, PAD_LEFT)
wait key
REM value = value to add padding to
REM padder = character to pad with
REM amount = total length you want the result to be
REM side = 1 for left padding, 2 for right padding
function pad$(value as string, padder as string, amount as integer, side as integer)
add = amount - len(value)
extra$ = ""
for t = 1 to add
extra$ = extra$ + padder
next t
if side = PAD_RIGHT
value = value + extra$
else
value = extra$ + value
endif
endfunction value
"Using Unix is the computing equivalent of listening only to music by David Cassidy" - Rob Pike