[REBOL] help on padding
From: carlos:lorenz at: 26-Nov-2000 10:38
Using the function below I'd like to get a sequence of seven days
starting from a date entered by the user but don't understand why
it does not work. Could you help me?
Thanks
--Carlos
REBOL[]
; Joel Nelly's function
zpad: func[n [number!] w[integer!] /local s][
s: to-string n
if w > length? s [
insert/dup s "0" (w - length? s)
]
s
]
dt: to-date ask "Enter start day: "
repeat i 7 [
; does not work
print rejoin[zpad dt/year 4 zpad dt/month 2 zpad dt/month 2]
; this works fine
print dt
dt: dt + 1
]