[Remind-Fans] Every Thursday except...

Ed Blackman ed at edgewood.to
Sat Sep 19 17:46:43 EDT 2020


On Sat, Sep 19, 2020 at 12:46:18PM -0500, Tim Chase wrote:
> On 2020-09-18 17:10, Ed Blackman wrote:
> > I also want to send myself a reminder the previous Friday when
> > there's an event on one of those Thursdays.  That was trickier, but
> > this is what I came up with:
> 
> you might be able to set a variable to the most recent trigdate() and
> then do some math on it to create the other event.  Something like
> 
>   OMIT Nov 26 2020 # Thanksgiving
>   REM Thu SKIP SATISFY [$Td < 3 || $Td > 9] MSG Thursday thing
>   IF trigvalid()
>     SET meeting $T
>     REM [meeting-6] RUN send_email -s "Send mail for [meeting]"
>   ENDIF
> 
> Based on a quick check, it seems to do what you intend.

It does.  Thank you!

One last question: what is the scope of variables in remind?  There's no 
discussion of scope in the man page, suggesting that there's only global 
scope, and that I should "UNSET meeting" before the ENDIF for 
cleanliness.

Is that correct?  A quick test shows that "meeting" is still set outside 
the IF block if I don't UNSET it, so it's not block scope, but I haven't 
used variables before so there might be some complexity I'm missing, or 
just no scopes/only global scope.

-- 
Ed Blackman



More information about the Remind-fans mailing list