Content-type: text/html Replace Tag

Home
WebGroove is no longer supported. These docs are reference only.


Replace Tag


The replace tag works like the define tag but doesn't expand any embedded tokens in the definition until the token is actually used somewhere. This gives you the capability to create "mini-macros" that can have different values depending on which tokens you have in their definition.

Examples
<replace replace_this with this, this and that>

<replace (c) &copy;>

<replace %product%>
<font size=-1>MySoftware(tm)</font>
</replace>


Time of Use Expansion
If you use tokens within a token created with replace, those tokens are expanded at time of use rather than time of definition. The difference is subtle and in most cases you can use replace and define interchangably.

<replace %copyright% %product% is Copyright(c)1998 MyCompany.>

Syntax
This tag can be a single or tag pair combination. Like other token-related Compiler tags, replace departs from the pure HTML attribute model. Token names must not contain spaces and should be less than 64 characters in length. The text you define for a token is a literal and should not include quotes unless you want them literally in the definition.

Naming
We recommend you pick some form of delimiter to denote tokens in your code. This prevents unexpected replacements. All of the following would be easy to spot:

%mytoken%
:token:
@token.member
%token.member%


Caution
Tokens can be any text. Therefore, you should not create a token for important things like "<" unless you want a disaster on your hands.

See Also
Compiler Tokens
Define Tag
Ifdef Tag
Ifnot Tag
Undef Tag

Up To
Compiler Tags
Complete Tag Reference


WebGroove® is a registered trademark of Creativision Publishing Corporation