| **Navigation:**  [[templates.htm|Templates]] > [[tlrcontents.htm|Template Language Reference]] > Complete Alpha Listing >====== #INSERT (insert code from a #GROUP) {{c6h0068.jpg|C6H0068.jpg}} ====== | [[ indent change indentation level .htm|{{btn_prev_n.gif|Previous page}}]][[tlrcontents.htm|{{btn_home_n.gif|Return to chapter overview}}]][[ invoke insert code from a named group .htm|{{btn_next_n.gif|Next page}}]] | | || **#INSERT(** //symbol //[ **(** //set// **)** ] [, //parameters// ] **)**[, //returnvalue// ] [, **NOINDENT **] {{blk2blue.jpg|blk2blue.jpg}} | **#INSERT** | Inserts code from a #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. | | **NOINDENT** | Specifies the code inserted retains the indention in its #GROUP--any source in column 1 in the #GROUP is generated into column 1, no matter where the #INSERT is placed. | The **#INSERT** statement places, at the exact position the #INSERT is located within the Template code, the code from the #GROUP named by the //symbol//. 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:** **#INSERT****(%SomeGroup)                      #!Ordinary insert** **#INSERT****(%GenerateFormulas(Clarion))      #!Insert #GROUP from Clarion Template** **#INSERT****(%FileRecordFilter,%Secondary)    #!Insert #GROUP with passed parameter** **#!#GROUP from Clarion Template with two passed parameters:** **#INSERT****(%FileRecordFilter(Clarion),%Primary,%Secondary) ** **See Also:     **[[ group reusable statement group .htm|#GROUP]] ,[[ call insert code from a group without indention .htm|#CALL]] ,[[ return return from group .htm|#RETURN]]