【发布时间】:2017-11-16 18:42:36
【问题描述】:
我试图以红色执行此脚本https://www.mail-archive.com/rebol-bounce@rebol.com/msg01222.html,但我不明白为什么会得到
现在计算工作日/日期 2007 年 2 月 3 日 [2007 年 2 月 1 日]
*** 脚本错误:> 运算符缺少参数
*** 地点:做
*** 堆栈:打印计算工作日
found?: func [
"Returns TRUE if value is not NONE."
value
][
not none? :value
]
calc-workdays: func [
"Return number of workdays between two dates, excluding holidays"
date1 [date!] "Start date"
date2 [date!] "End date"
holidays [block!] "Block of dates to exclude (holidays, etc.)"
/non "Return number of non-work days (weekend + holidays) between 2 dates"
/local days day1 day2 diff param
][
days: copy []
set [day1 day2] sort reduce [date1 date2]
diff: day2 - day1
param: pick [[> 5 union][< 6 exclude]] either found? non [1][2]
loop diff [
day1: day1 + 1
if do param/1 day1/weekday param/2 [append days day1]
]
return length? do param/3 days holidays
]
【问题讨论】: