# htp on-line reference : SET

## syntax

`<def name="sharedimg" option="name alt">
<img src="/home/sharedimages/${name}" alt="${alt}">;
</def>
<sharedimg name="bubble.gif" alt="Bubble image">
`

## synopsis

SET creates a macro definition that can later be expanded anywhere in the HTML document. To create a macro:

`<use macroname [parameters ...] [noexpand]>
<... $macroname ...>
<... ${macroname} ...>
`

The macro "emailaddr" can then be expanded later. The USE tag is used to expand the macro outside a tag (i.e., into the regular text). If the macro needs to be expanded inside a markup tag, use the '$' operator.

Multiple macros can be declared in a single markup tag, as the second syntax line shows.

SET should only be used for a single line's worth of text. Multi-line macros can be defined with the BLOCK tag. The BLOCK tag is also useful if the macro contains a quotation character and you don't want to fool around with special escape characters.

Macros can be redefined by using another SET command with the same macro name. The prior definition will be destroyed, however. Also, the macro can be removed (destroyed) with the UNSET tag.

hosted by Sourceforge HTML coding

Copyright © 1995–96 Jim Nelson. Copyright © 2001–2014 Jochen Hoenicke. Permission to reproduce and distribute this hypertext document granted according to terms described in the License section. last updated Sat May 16, 2015