| **Navigation:**  [[templates.htm|Templates]] > [[tlrcontents.htm|Template Language Reference]] > Complete Alpha Listing >====== #DEFINE (user defined macro) ====== | [[ default default procedure starting point .htm|{{btn_prev_n.gif|Previous page}}]][[tlrcontents.htm|{{btn_home_n.gif|Return to chapter overview}}]][[ delete delete a multi valued symbol instance .htm|{{btn_next_n.gif|Next page}}]] | | || **#DEFINE ( **//%macro name//**// //****)** //     statements// **#ENDDEFINE** {{blk2blue.jpg|blk2blue.jpg}} | **#DEFINE** | Defines a user defined macro that can be expanded using #EXPAND. | | //%macro name// | A user defined symbol used as the macro's identifier. | | //Statements// | A sequence of statements. | | **#ENDDEFINE** | Terminates the definition of a user defined macro. | **#DEFINE **defines the beginning of a section of code which can be expanded into generated code using the #EXPAND statement. A macro may not be defined with any parameters. #DEFINE must be terminated with #ENDDEFINE. Using #DEFINE and #EXPAND to define and expand macros for commonly used code sections will lead to cleaner template code while hiding unneeded target code from immediate view. **Example:** **#DEFINE****(%InRangeCheck)** **  IF %ControlUse <;= TODAY()** **   SELECT(?%ControlUse)** **  END** **#ENDDEFINE** **See Also:     **[[ expand expand a user defined macro .htm|#EXPAND]]