[Remind-Fans] best way to handle a list of dates

David F. Skoll dfs at roaringpenguin.com
Thu Dec 18 22:33:36 EST 2014


On Thu, 18 Dec 2014 17:02:19 -0500
"Ian! D. Allen" <idallen at idallen.ca> wrote:

> What's the best way to handle a reminder that occurs on a list of a
> dozen or more dates that don't have a regular pattern?  Can FSET
> simplify this?

>     IFTRIG Jan  5 2015 ++5 SKIP
>        set p trigdate()
>     ENDIF
>     IFTRIG Mar 19 2015 ++5 SKIP
>        set p trigdate()
>     ENDIF
>     IFTRIG May 29 2015 ++5 SKIP
>        set p trigdate()
>     ENDIF

... etc ..

This is the best I can come up with.  It uses relatively modern Remind
features, so you might need to be running the latest version (3.1.13)

# Note: Strings!
set d1 "2015-01-05"
set d2 "2015-03-19"
set d3 "2015-05-29"
# ... etc

SET t iif(evaltrig(d1) != -1, d1, \
          evaltrig(d2) != -1, d2, \
          evaltrig(d3) != -1, d3, \
          -1)
# ... Add more cases to the iif as necessary

if typeof(t) == "STRING"
   REM [t] PRIORITY 1030 ++5 SKIP MSG %"Biodanza%" %b.
endif

The new features are the "evaltrig" function and the ability to provide
something like 2015-01-05 directly to a REM statement instead of passing
it through trigger() first.  Newer versions of Remind also allow
lines continued with backslashes to be as long as you want which
could be important if you have a huge list of dates.

Regards,

David.


More information about the Remind-fans mailing list