Crestron
e-control Mail SW-MAIL
48
••
Text Substitution and File Inclusion
Installation & Reference Guide — Doc. 5798
The contents of the
first
and
last
fields are concatenated together
when echoed by the
EchoRecp
signal.
If the
Echo Lookups
option is in effect, these data are echoed back to the control
system as well (using the
EchoRecp
and
EchoRcptAddr
signals).
If the
Show Indirection
option is also checked, a
>
character is prefixed to the
echoed strings to indicate the indirection. If e-mailer signal block default data is
being echoed, a second
>
character is prefixed (double default). (These
>
characters are not recorded; they are echoed for display purposes only.)
If the
defaultAddr
field is zero (or less) (or blank), the e-mailer signal block default
name and address is recorded and echoed (if
Echo Lookups
is on) (with double
>
characters, if
Show Indirection
is on).
All of the above only occurs when no name has been explicitly selected. If an
explicit selection is subsequently made, it overrides any defaults already recorded.
The usefulness of the behavior described above can be better appreciated by playing
with demo 2 (using record ID numbers), or demo 3 (using the interactive scrollers).
Manual Selection of Recipient and/or Message
e-Mail scroller signal blocks — or custom scroller signal blocks if you are licensed
for the e-control Database Manager product (SW-DBM) — can be defined and
“bound” to an e-mailer signal block. First create the scroller signal block, then bind it
to an e-mailer signal block in the latter’s “Signal Block Definition” window. Add the
DBMScroller
macro to your SIMPL program to display on the touchscreen the
database tables as interactive scrolling lists. Picking (touching) elements in these
lists, depending on the list, either add a recipient to the recipient list or set up a
message — in exactly the same way as if the “lookup” signals had been used.
Text Substitution and File Inclusion
There are two text substitution schemes which are applied consecutively and
repetitively to both the subject header text and the body text, text substitution
directives, and textfile inclusion directives. Consecutively means that text
substitution occurs before textfile inclusion. Iteratively means that after both
schemes have been applied to the text, if any substitutions were made, both schemes
are reapplied. This process continues until no further substitutions occur.
Text Substitution Directives
The number of
SetParm
and
LookupParm
signals defined in a
typically e-Mailer signal block are
four (4) signals (each).
Text substitution directives reference a set of text substitution registers. Think of text
substitution registers as numbered cubbyholes, each containing a text string. Text
substitution registers are referred to by number, starting from 1 and continuing up
through
n,
where
n
is defined as the greater of the number of
SetParm
signals and
LookupParm
signals defined for a particular e-Mailer signal block.
The text substitution routine scans the text for directives, represented by constructs
with the following syntax:
~{m}
where
m
is a base-10 number from 1 to
n
.
Wherever such a construct is found in the text, it is replaced with the current contents
of the text substitution register.
Note that directives do not require any further delimitation. That is, a directive does
not need to be surrounded by spaces or any other punctuation. This makes it possible
for a directive to appear in the middle of a word, which is often useful.