[Remind-Fans] Moving trash day around when holidays occur on weekdays before
Dianne Skoll
dfs at roaringpenguin.com
Sun Apr 8 11:21:36 EDT 2018
On Fri, 6 Apr 2018 20:21:51 -0500
Tim Chase <remind at tim.thechases.com> wrote:
> Is there some way to scan backwards for any OMITs that occur during
> the weekdays on/prior to a given trigger-date?
I had to solve this *exact* problem. Here's my solution:
#=======================================================================
# Garbage
# Set garbday to the usual weekday of garbage collection where
# Monday == 1 and Friday == 5. Set garbdayname to the matching
# day name.
# Example below: Friday
set garbday 5
set garbdayname "Friday"
fset _garbhol(x) wkdaynum(x) == garbday && slide(x-garbday, garbday) != x
fset _garbdel() iif($Tw != garbday, " (Delayed)", "")
REM [garbdayname] AFTER OMITFUNC _garbhol MSG Garbage[_garbdel()]
#=======================================================================
To understand how this works, you'll need to look up the OMITFUNC clause
and the "slide" function definition. And translate from Canadian ("garbage")
to American ("trash") :)
The basic idea is that the _garbhol function returns 1 if any of the
preceding weekdays (including this one) is OMITted, and 0 otherwise.
Regards,
Dianne.
More information about the Remind-fans
mailing list