[Remind-Fans] need eval() function to expand expressions inside strings
Ian! D. Allen
idallen at idallen.ca
Wed May 27 13:33:30 EDT 2015
There doesn't seem to be a way to make remind expand expressions inside
variables/strings. If I want the same reminder to appear in multiple
different forms I can't just write the text string once and assign it
to a variable for later expansion, if it contains any expressions. I
have to duplicate all the expressions I use in each reminder, e.g.:
set text "My event"
set date "AT 12:00"
REM [date] MSG %"%"[trigtime()] [text]
REM [date] SPECIAL HTML <p class="foo">[trigtime()] [text]</p>
The use of [trigtime()] above could be any variable or expression that
I really should only have to write once since it's the same in every
reminder.
What might work as a future enhancement is an "eval"-like function to
expand embedded expressions inside strings, e.g.:
set text "[trigtime()] My event"
set date "AT 12:00"
REM [date] MSG %"%"[eval(text)]
REM [date] SPECIAL HTML <p class="foo">[eval(text)]</p>
--
| Ian! D. Allen - idallen at idallen.ca - Ottawa, Ontario, Canada
| Home Page: http://idallen.com/ Contact Improv: http://contactimprov.ca/
| College professor (Free/Libre GNU+Linux) at: http://teaching.idallen.com/
| Defend digital freedom: http://eff.org/ and have fun: http://fools.ca/
More information about the Remind-fans
mailing list