14.2.1 Overview

DEFINE macro_name([argument[/argument]…])body!ENDDEFINE.

Each argument takes the following form:

{!arg_name= | !POSITIONAL}
[!DEFAULT(default)]
[!NOEXPAND]
{!TOKENS(count) | !CHAREND('token') | !ENCLOSE('start' | 'end') | !CMDEND}

The following directives may be used within body:

!OFFEXPAND
!ONEXPAND

The following functions may be used within the body:

!BLANKS(count)
!CONCAT(arg)
!EVAL(arg)
!HEAD(arg)
!INDEX(haystack, needle)
!LENGTH(arg)
!NULL
!QUOTE(arg)
!SUBSTR(arg, start[, count])
!TAIL(arg)
!UNQUOTE(arg)
!UPCASE(arg)

The body may also include the following constructs:

!IF (condition) !THEN true-expansion !ENDIF
!IF (condition) !THEN true-expansion !ELSE false-expansion !ENDIF

!DO !var = start !TO end [!BY step]
  body
!DOEND
!DO !var !IN (expression)
  body
!DOEND

!LET !var = expression