4
2
<use macroname [parameters ...] [noexpand]>
6
4
<... ${macroname} ...>
11
<STRONG>USE</STRONG> will expand macros that have been previously
9
<strong>USE</strong> will expand macros that have been previously
12
10
declared with either <A HREF="set.html">SET</A> or <A
13
11
HREF="block.html">BLOCK</A>. USE can only be used outside of other
16
<p> Normally the value of expanded block macros will be further parsed
17
by htp. This is maybe not what you want, for example, if the use is
18
inside a block which <a href="expand.html">expands</a> itself. You can
19
use the noexpand attribute to prevent further expansion. </p>
14
<p> If you USE a block macro the value of expanded block macros will
15
be further parsed by htp. This is maybe not what you want, for
16
example, if the use is inside a block which <a
17
href="expand.html">expands</a> itself. You can use the noexpand
18
attribute to prevent further expansion. </p>
21
<P> USE will accept additional parameters, which are "local" macros
20
<p> USE will accept additional parameters, which are "local" macros
22
21
for the expanded macro. This is only valid for <A
23
22
HREF="block.html">BLOCK</A> macros. Macros created using <A
24
23
HREF="set.html">SET</A> cannot have parameters passed. For
27
26
<htpcode option="-n">
29
<A HREF=$email>send email</A>
32
<SET morestuff=$email>
34
This works: <USE stuff email="jnelson@crl.com">
35
But this fails: <USE email>
36
And this fails: <USE morestuff email="jnelson@crl.com">
28
<a href=$email>send email</a>
31
<set morestuff=$email>
33
This works: <use stuff email="jnelson@crl.com">
34
But this fails: <use email>
35
And this fails: <use morestuff email="jnelson@crl.com">
46
45
Note that the "email" macro is available to other macros or included
47
46
files called within the "stuff" block.
49
Inside a markup tag, like <A HREF="img.html">IMG</A>, A (anchor), or any
50
other standard HTML or htp tag, the '$' operator should be used. The '$'
51
should be immediately followed by the macro name, which may or may not be
52
surrounded by curly braces.
48
Inside a markup tag, like <a href="img.html">IMG</a>, A (anchor), or
49
any other standard HTML or htp tag, the '$' operator must be used.
50
The '$' should be immediately followed by the macro name, which may or
51
may not be surrounded by curly braces. When htp encounters this it
52
replaces the macro name by the contents of the macro without further
53
processing the contents.
54
55
<htpcode option="-n">
55
56
<a href="mailto:$email">mailto hyperlink</a>
72
73
If the '$' macro is surrounded by other text (as in the two examples above),
73
74
quotation marks are not automatically supplied.
75
Note that a '$' macro can be placed anywhere in a markup tag. This is valid:
76
Note that a '$' macro can be placed anywhere in a markup tag and can
77
be nested. This is valid:
78
<${tagName} ${attrName}=${attrValue}>
80
<${tagName} ${attrName}=${value$ctr}>
83
<P> The tagName macro can contain any tag name, even a self-defined
84
metatag. Note that <code>$ctr</code> is expanded before the valueX
85
macro is expanded, so assuming that ctr was set to 1 it will expand