[Remind-Fans] Specific use cases for %b and %1 substitutions

Dianne Skoll dianne at skoll.ca
Sun Oct 9 16:21:20 EDT 2022


On Sun, 9 Oct 2022 21:32:12 +0200 (CEST)
l0f4r0--- via Remind-fans <remind-fans at lists.skoll.ca> wrote:

> 1) Ignore %b substitution if value is "today"?

Yes.  Remind allows you to override substitutions.  So:

FSET subst_b(a, d, t) iif(d==today(), "", d==today()+1, "tomorrow", "in " + (d-today()) + " days' time")

I made this file called "b.rem" as a demo:

#===============
FSET subst_b(a, d, t) iif(d==today(), "", d==today()+1, "tomorrow", "in " + (d-today()) + " days' time")

REM 11 Oct +2 MSG 2: %b
REM 10 Oct +2 MSG 1: %b
REM 9 Oct +2 MSG 0: %b
#===============

$ remind b.rem
Reminders for Sunday, 9th October, 2022 (today):

2: in 2 days' time

1: tomorrow

0: 

> 2) Substitute %1 only within timed reminders context (no delta)

> Indeed, I have various timed reminders with delta and I only want to
> display their %1 value if they are for today. No 2 days ahead and so
> on...

Similarly, define a "subst_1" function that does what you need.  See the
section RUN-TIME MODIFICATION OF THE SUBSTITUTION FILTER in the Remind
man page.

Regards,

Dianne.


More information about the Remind-fans mailing list