[Remind-Fans] SATISFY and/or setting variables in REM

hymie at lactose.homelinux.net hymie at lactose.homelinux.net
Tue Aug 2 10:03:07 EDT 2016


Greetings.

I'm (always) trying to do more with remind.  I have a question about
SATISFY.

I do a lot of things like this:
rem 2016-09-06 *56 omit sat sun after SATISFY 1
if (trigvalid())
  SET rootpasswd trigdate()
  rem [rootpasswd] SPECIAL COLOR 255 0 0 Root Password Changes
endif

(It's actually more complicated than that, but suffice it to say, I need
the variable set to the trigdate.)

But sometimes my date ranges change.  So I actually have this:

rem 2016-03-21 *56 until 2016-08-01 omit sat sun after SATISFY 1 (line A)
rem 2016-09-06 *56 omit sat sun after SATISFY 1                  (line B)
if (trigvalid())
  SET rootpasswd trigdate()
  rem [rootpasswd] SPECIAL COLOR 255 0 0 Root Password Changes
endif

This works for September 6 and November 1.  But it doesn't work for
July 11th, which would have been the last day that line A would have
matched.

So I guess I just answered my first question, that the trigvalid()
only works for the immediately preceeding SATISFY.  Once line A
matched and SATISFY worked and set trigvalid to 1, then line B
happened and set trigvalid back to 0.

So here's my next question.  Is there a way to set a variable as the
"action" taken by a REM statement?  Because in theory [1], this kind
of thing might work:

UNSET rootpassword
rem 2016-03-21 *56 until 2016-08-01 SET rootpasswd trigdate()
rem 2016-09-06 *56 SET rootpasswd trigdate()
if defined("rootpasswd")
  rem [rootpasswd] SPECIAL COLOR 255 0 0 Root Password Changes
endif

except that, as far as I know, I can't use the SET command in this
manner.  The only way I know is through repetition:

rem 2016-03-21 *56 until 2016-08-01 omit sat sun after SATISFY 1
if (trigvalid())
  SET rootpasswd trigdate()
endif
rem 2016-09-06 *56 omit sat sun after SATISFY 1
if (trigvalid())
  SET rootpasswd trigdate()
endif

Can I do better?

By any chance, is "SET rootpasswd trigdate()" an "expression" that returns
a true value, and I can do this:

rem 2016-03-21 *56 until 2016-08-01 SATISFY SET rootpasswd trigdate()
rem 2016-09-06 *56 SATISFY SET rootpasswd trigdate()

?

--hymie!     http://lactose.homelinux.net/~hymie    hymie at lactose.homelinux.net

[1] Everything works in theory.  http://i.imgur.com/eKjNHWF.png


More information about the Remind-fans mailing list