%META:TOPICINFO{author="ProjectContributor" date="1505958329" format="1.1" version="1"}%
%META:TOPICPARENT{name="Macros"}%
---+ SET -- set a preference setting during runtime
A preference setting created via a =%SET= macro is usable by the topic containing the =%SET= statement, and in any other topics =%INCLUDing= or =%INCLUDEd= when
rendering the topic TML. This is unlike list or META style [[preference settings]] which are only set when the base topic is loaded, and never set during macro expension when
an =%INCLUDEd= topic is processed.

A =TMPL:DEF= template definition containing =%SET= macros will also add those values to the current scope as if these settings have been
parsed as part of the base topic's text.

Setting a preference setting in a list like in

<verbatim class="tml">
   * Set foo = %SEARCH{...
</verbatim>

or in META settings will store the _text_ of the TML expression.

The equivalent %SET statement:

<verbatim class="tml">
%SET{"foo" value="%SEARCH{..."}%
</verbatim>

will store the _result_ of the TML expression as a consequence of the parser processing
macros inside-out-left-to-right.
---++ Parameters
     %TABLE{sort="off"}%
     | *Parameter* | *Description* | *Default* |
     | ="name"= | Name of preference to set | |
     | =value= | Value to set it to | |
---++ Examples
To cache the result of another macro use =%<nop>SET{"search_result" value="%<nop>SEARCH{...}%"}%=. The result of the =value= expression will be temporarily bound to the variable
=%<nop>search_result%= and might be used within the scope of the current topic being processed, or in =%INCLUDing= or other =%INCLUDEd= topics.

Note that this macro does NOT expand [[format tokens]] that are used to alter the macro processing sequence. ($percent, $dollar, ...).
%STOPINCLUDE%
---++ Related
 PreferenceSettings

