#CALL (insert code from a #GROUP, without indention) 

Top  Previous  Next

 

#CALL( symbol [ ( set ) ] [, parameters ] ) [, returnvalue ]

#CALL

Inserts code from a #GROUP, retaining the indention in its #GROUP.

symbol

A symbol that names a #GROUP section.

set

The #TEMPLATE name parameter for the template set to which the #GROUP belongs. If omitted, the #GROUP must be of the same template set name as the #PROCEDURE in which it is used.

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.

returnvalue

A symbol to receive the value returned by the #RETURN statement.

The #CALL statement places the code from the #GROUP named by the symbol, retaining the indention in its #GROUP--any source in column 1 in the #GROUP is generated into column 1, no matter where the #CALL is placed This is equivalent to using #INSERT with the NOINDENT parameter.

The set parameter specifies the #TEMPLATE that contains the #GROUP. This allows any Template to use #GROUP code from any other registered Template. 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.

The returnvalue symbol receives the value returned by the #GROUP from the #RETURN statement that terminates the #GROUP. If the #GROUP does not contain a #RETURN statement, or that #RETURN does not have a parameter, then the value received is an empty string ('').

Example:

#CALL(%SomeGroup)                      #!Ordinary insert retaining original indention

#CALL(%GenerateFormulas(Clarion))      #!Insert #GROUP from Clarion Template

#CALL(%FileRecordFilter,%Secondary)    #!Insert #GROUP with passed parameter

#!#GROUP from Clarion Template with two passed parameters

#CALL(%FileRecordFilter(Clarion),%Primary,%Secondary)

 

See Also:     #GROUP ,#INSERT ,#INVOKE ,#RETURN