Navigation: Templates > Template Language Reference > Built-in Template Procedures >====== INVOKE (call a named #GROUP as a function) ====== | |
INVOKE( symbol [, parameters ] )
INVOKE | Calls a named #GROUP as a function. |
symbol | A symbol that contains the name of a #GROUP section in the current template set. |
parameters | The parameters passed to the #GROUP. Each parameter must be separated by a comma. All parameters defined for the #GROUP must be passed; they may not be omitted. |
The INVOKE procedure places the return value from the #GROUP named in the symbol into the expression containing the INVOKE.
The parameters passed to the #GROUP fall into two categories: value-parameters and variable-parameters. Value-parameters are declared by the #GROUP as a user-defined symbol, while variable-parameters are declared by the #GROUP as a user-defined symbol with a prepended asterisk (*). Either a symbol or an expression may be passed as a value-parameter. Only a symbol may be passed as a variable-parameter.
Return Data Type: STRING
Example:
#SET(%SomeGroup,CALL(%SelectAGroup)) #!Call %SelectAGroup to get a #GROUP name
#SET(%AnotherGroup,INVOKE(%SomeGroup)) #!Call Selected Group for another #GROUP name
#INVOKE(%AnotherGroup) #!Insert either %DoTrueGroup or %DoFalseGroup
#GROUP(%SelectAGroup)
#IF (%SomeCondition)
#RETURN('%TrueGroup(Clarion)')
#ELSE
#RETURN('%FalseGroup(Clarion)')
#ENDIF
#GROUP(%TrueGroup)
#RETURN('%DoTrueGroup(Clarion)')
#GROUP(%FalseGroup)
#RETURN('%DoFalseGroup(Clarion)')