SET -- set a preference setting during runtime

A preference setting created via %SET will only be usable on the topic where it has been found by the parser, similar to normal PreferenceSettings. Each call to %INCLUDE opens a new scope for preference variables. An %INCLUDE of another topic containing a %SET statement will not define those values in the including topic's scope. In contrast, a TMPL:DEF template definition containing %SET macros will add those values to the current scope as if these settings have been parsed as part of the current topic's text.

Setting a preference setting in a list like in

   * Set foo = %SEARCH{...

will store the text of the TML expression.

The equivalent %SET statement:

%SET{"foo" value="%SEARCH{..."}%

will store the result of the TML expression as a consequence of the parser processing macros inside-out-left-to-right.

Parameters

Parameter Description Default
"name" Name of preference to set  
value Value to set it to  

Examples

To cache the result of another macro use %SET{"search_result" value="%SEARCH{...}%"}%. The result of the value expression will be temporarily bound to the variable %search_result% and might be used within the scope of the current topic being processed

PreferenceSettings
Topic revision: r1 - 18 Jun 2015, ProjectContributor - This page was cached on 14 May 2019 - 06:40.

THE UNIVERSITY OF UTAHSPENCER S. ECCLES HEALTH SCIENCES LIBRARY
10 N. 1900 E. SALT LAKE CITY, UT 84112 • 801.581.7535
Ideas, requests, problems regarding Eccles Health Sciences Library wiki? Send feedback