[Remind-Fans] iif() syntax (was Re: syntax help)

Dianne Skoll dianne at skoll.ca
Thu Jul 20 21:34:58 EDT 2023


On Thu, 20 Jul 2023 19:23:43 -0500
Tim Chase via Remind-fans <remind-fans at lists.skoll.ca> wrote:

>   FSET moviechooser(d) iif(wkdaynum(d) == 2,\
>       "Mom", \
>       iif((d - BOT) % 14 < 8, "Eben", "Amanda") \
>       )

iif() can take any odd number of arguments, so you don't need to nest
them. The expression:

iif(test1, result1, test2, result2, ..., testN, resultN, default)

returns result1 if test1 is true, result2 if test2 is true, ...,
resultN if testN is true, and default if none of the tests is true.

[Eben King]
>> Is there a more succinct way of getting a day counter other than
>> by doing realtoday() - 2000-01-01 ?

As Tim mentioned, you want to use $T and not realtoday().  Fun fact:
The expression coerce("INT", $T) gives exactly the same answer as
$T - '1990-01-01' but it's also exactly the same number of characters
to type. :)

Regards,

Dianne.


More information about the Remind-fans mailing list