[Remind-Fans] Ignore REM a posteriori (depending on further processing)

l0f4r0 at tuta.io l0f4r0 at tuta.io
Mon Jun 19 01:22:51 EDT 2023


Hi,

14 juin 2023, 21:21 de remind-fans at lists.skoll.ca:

>> REM 10 October MSG [myfunc(2020)]
>> FSET myfunc(myarg) iif(myarg==$Ty,"result1",myarg>$Ty,"result2",IGNORE_ASSOCIATED_REM)
>>
> In this case, Remind would have to be clairvoyant, because the function
> is only defined after the REM statement. :P
>
Oops, indeed... ;p

> For your specific case
>
> FSET myfunc(x) iif(x == $TY, "result1", "result2")
> REM 10 October UNTIL 2020-10-10 MSG [myfunc(2020)]
>
> And yes, 2020 is duplicated, but c'est la vie.  Having something that
> can "cancel" a REM statement would make reminder files extremely
> difficult to debug, IMO.
>
> You can get away without passing 2020 into myfunc, and instead have
> it look at year(triguntil()) but that would mean the function would
> only work if there is an UNTIL clause.
>
Actually, here was my complete scenario:

As I cannot write (because of FROM limitation):
FSET birthday_or_anniversary(year, name) iif(year==$Ty, name + "'s birthday", name + "'s anniversary [" + ($Ty-year) + " year(s)]")
REM 10 February FROM 1970-02-10 MSG [birthday_or_anniversary(1970, "Tom")]

I was thinking about something like:
FSET birthday_or_anniversary(year, name) iif(year==$Ty, name + "'s birthday", year<$Ty, name + "'s anniversary [" + ($Ty-year) + " year(s)]", IGNORE_ASSOCIATED_REM)
REM 10 February MSG [birthday_or_anniversary(1970, "Tom")]

So you see I was not looking for an UNTIL clause but a FROM one ;)
NB: I think I misled you because I made a typo in my original post ("myarg>$Ty" instead of "myarg<$Ty").

I could have written...:
FSET birthday_or_anniversary(year, name) iif(year==$Ty, name + "'s birthday", name + "'s anniversary [" + ($Ty-year) + " year(s)]")
REM 10 February SATISFY [$Ty>=1970] MSG [birthday_or_anniversary(1970, "Tom")]

...but I've just dropped the idea because upon reflection I don't really need a start date (otherwise I would need to search for one in all my other reminders to be consistent and that would be a lot of work for little gain and less legibility).

Question not related: it is not possible to define a variable inside a user-defined function, is it?
For example something like that:
FSET test(x) SET difference $Ty-x; iif(difference>=10, "result1", difference>=5, "result2", "result3") + " [" + difference + "]"
doesn't work so I need to write $Ty-x everywhere instead
l0f4r0


More information about the Remind-fans mailing list