Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://wiki.cmc.msu.ru/System/VarEXPAND?cover=print
Дата изменения: Unknown Дата индексирования: Sun Apr 10 07:27:17 2016 Кодировка: |
expression
as if they were used in the topic topictoexpandin
. The viewer must have VIEW access to topictoexpandin
for this to work. All the standard formatting macros can be used in expression
, such as $percent
and $quot
.
EXPAND
can be useful when you want to pick up the value of macros defined in another topic. For example, you might want to define a set of preferences in one topic, but pick up their value in another topic (this is very useful when building reusable applications). In this case you can write:
* Set MYPREFERENCE = valuein "SettingsTopic" and then, in "MyTopic", write:
%EXPAND{"$percentMYPREFERENCE$percent" scope="SettingsTopic"}%Of course we can also write:
%EXPAND{"$percentMYPREFERENCE$percent" scope="%OTHERTOPIC%"}%which lets us select which other topic to get the preference value from.
Additional parameters can be passed to the macro being expanded using the standard macro syntax in the name of the macro; for example,
%EXPAND{"$percentMYPREFERENCE{$quotdefault$quot param=$quotvalue$quot}" scope="SettingsTopic"}%Notes:
EXPAND
is not very efficient, and should be used sparingly.
scope="Theotherweb.%WEBPREFSTOPIC%"