############################################################
# @(#) Macros, Dirk Hagedorn, 1996/04/16
# 07/14/1996: Macros with parameters
############################################################

!subsubnode Macros

Macros are userdefined placeholders that you can use for different
purposes.

!index !/macro

When using the (!I)!/macro(!i) command you tell UDO the name of the macro in
first place. The name of the macro is followed by its contents which may be
empty, too.

Let me show you some examples:

!begin_quote
!begin_verbatim
!macro HTML Hypertext Markup Language
!macro UDO  (!B)U(!b)niversal (!B)Do(!b)cument
!macro DOSG (!T)UDO6GDOS.ZIP(!t)
!ifdest [html]
  !macro PICPATH gif/
!else
  !macro PICPATH img/
!endif
[...]
The (!HTML) ...
The (!UDO) Format ...
The archive named (!DOSG) ...
!image (!PICPATH)/tiger
!end_verbatim
!end_quote

!index !/include
Macros can help you to save time when typing often used long words.
Furthermore macros can help you to change the contents of your file by
simply changing the contents for macros (e.g. if your program name changed
and you use a macro for the name of your program). Another example is the
usage of standardized text (e.g. a standard disclaimer) where you use macros
instead of the name of the program etc. These standardized texts can be
included with (!I)!/include(!i). In the following example a disclaimer is
included and the name of the program is defined by a macro:

!begin_quote
!begin_verbatim
[doku.u]
!macro PRG Windows95
[disclaim.u]
(!PRG) is provided ""as is"" without a
warranty of any kind.
Use it on your own risk.
!end_verbatim
!end_quote

!smallskip

!index Macros !! Parameters
!index Parameters !! Macros

Since UDO Release 6 you can call macros with parameters. You can set the
position of the parameters in the (!I)!/macro(!i) command by inserting
''(!T)(!/1)(!t)'', ''(!T)(!/2)(!t)'' till ''(!T)(!/9)(!t)''. To call a macro
with parameters you have to write brackets (''[!..]'') around them.

The following small example shows how to use a macro for text that shall be
printed in bold-italic style:

!begin_quote
!begin_verbatim
!macro BI (!B)(!I)(!1)(!i)(!b)
...
This text is printed (!BI [bold and italic]).
!end_verbatim
!end_quote

The ""(!/1)"" in the macro line will be replaced by the words ""bold and
italic"".

!smallskip

(!HINTS)

!begin_enumerate

!item When naming the macros you should be cautious not to use pre-defined
UDO command names like ""B"" or ""nl"". If you don't you will get problems
with bold text ((!/B)) or the newline command ((!/nl)).

!item You shouldn't use too many macros because every additional macro slows
down the conversion of the source file. The maximum number of macro is
(!MAXMACRO).

!end_enumerate
