[Remind-Fans] syntax help

eben at gmx.us eben at gmx.us
Thu Jul 20 14:30:15 EDT 2023


On 7/20/23 14:08, Dianne Skoll via Remind-fans wrote:
> On Thu, 20 Jul 2023 14:00:48 -0400
> Eben King via Remind-fans <remind-fans at lists.skoll.ca> wrote:
>
>> 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.

Ah, I assumed it would express the date as a day count relative to the
beginning of time.  Nope.  OK.

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

So if you're going to do an if-then in one, it needs to be iif()?

> 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)]

Thank you, I appreciate it.

--
We, the unwilling, led by the unknowing, are doing the impossible for
the ungrateful. We have done so much, for so long, with so little, we
are now qualified to do anything with nothing. -- Konstatin Jireček




More information about the Remind-fans mailing list