[Remind-Fans] syntax help

Dianne Skoll dianne at skoll.ca
Thu Jul 20 14:08:30 EDT 2023


On Thu, 20 Jul 2023 14:00:48 -0400
Eben King via Remind-fans <remind-fans at lists.skoll.ca> wrote:

> OK.  Here's the situation.  I have movie nights twice a week, "Movie
> Night" on Friday, and "Auxiliary Movie Night" on Tuesday.  On
> Tuesday, Mom always chooses the movie, and on Friday we alternate
> between me (Eben) and the wife (Amanda).  So I want to make a
> function that spits out the right name, depending on what day it is.

> Tuesday is easy, it's always Mom.  Friday, the easiest solution I can
> come up with is to check if the date odd or even.

That won't work.  Friday, July 28, 2023 has an even day number, but so does
the following Friday, August 4 2023.

You need to pick a reference date in the past and check it mod 14.

> So far this is
> what I have:

>      13	FSET moviechooser(d) \
>      14	  IF d == "tuesday" \

Functions can't be defined in terms of blocks of code; they can only
be simple expressions.

Let's assume that on Friday, January 6th 2023 it was Eben's turn to pick
a movie.  Then this should work:

#======================================================================
FSET moviechooser(d) iif(wkdaynum(d) == 2, "Mom", \
                         (d - '2023-01-06') % 14, "Amanda", "Eben")

REM Tuesday Friday MSG Movie night: [moviechooser($T)]
#======================================================================

Regards,

Dianne.




More information about the Remind-fans mailing list