[Remind-Fans] Different message every N days with OMITs
Ed Blackman
ed at edgewood.to
Wed Feb 8 22:55:26 EST 2017
I'm using remind to help me train for a race. I train every N days
(currently every other day, but would like a generic solution for future
training), with a different set of activities to do each time.
Sometimes I can't train on a given day due to scheduling or injury, and
want to pick up where I left off on the next non-omitted day.
Here's what I've been able to do on my own:
OMIT 2017-02-10
OMIT 2017-02-13
set start_date '2017-02-08'
set end_date '2017-04-15'
# index 1 is the text for omitted days, index 2 is the first activity
set training_idx nonomitted(start_date, max(today(), start_date)) + 2
set training_day iif(isomitted(today()), 1, training_idx)
set activity choose(training_day, \
"rest", \
"Activity 1", \
"Activity 2", \
"Activity 3", \
"Activity 4", \
"Activity 5", \
"")
FROM [start_date] UNTIL [end_date] MSG [activity]
This produces:
$ remind -s1 runtraining
2017/02/08 * * * * Activity 1
2017/02/09 * * * * Activity 2
2017/02/10 * * * * rest
2017/02/11 * * * * Activity 3
2017/02/12 * * * * Activity 4
2017/02/13 * * * * rest
2017/02/14 * * * * Activity 5
That's almost correct, except that it doesn't alternate days. I've
tried adding an OMITFUNC, but days omitted by OMITFUNC aren't picked up
by isomitted(), so the training_idx calcuations are wrong (some
activities get skipped). I'd like output like this from the same
choose() arguments:
2017/02/08 * * * * Activity 1
2017/02/09 * * * * rest # alternate day
2017/02/10 * * * * rest # omitted
2017/02/11 * * * * Activity 2
2017/02/12 * * * * rest # alternate day
2017/02/13 * * * * rest # omitted
2017/02/14 * * * * Activity 3
2017/02/15 * * * * rest # alternate day
2017/02/16 * * * * Activity 4
2017/02/17 * * * * rest # alternate day
2017/02/18 * * * * Activity 5
Any suggestions? Remind 03.01.10, but willing to upgrade if a newer
version is capable of producing the desired output.
--
Ed Blackman
More information about the Remind-fans
mailing list