| **Navigation:**  [[templates.htm|Templates]] > [[tlrcontents.htm|Template Language Reference]] > Complete Alpha Listing >====== #ATSTART (template initialization code){{c6h0068.jpg|C6H0068.jpg}} ====== | [[ atend template reset code .htm|{{btn_prev_n.gif|Previous page}}]][[tlrcontents.htm|{{btn_home_n.gif|Return to chapter overview}}]][[ boxed prompt group box .htm|{{btn_next_n.gif|Next page}}]] | | || **#ATSTART** //statements// **#ENDAT** {{blk2blue.jpg|blk2blue.jpg}} | **#ATSTART** | Specifies template code to execute before the #PROCEDURE, #CODE, #CONTROL, or #EXTENSION generates. | | //statements// | Template language code. | | **#ENDAT** | Terminates the section. | The **#ATSTART** structure specifies template code to execute before the #PROCEDURE, #CODE, #CONTROL, or #EXTENSION generates its code. Therefore, the //statements// should normally only contain Template language. #ATSTART is usually used to initialize internal template variables. You may not place #ATSTART within any type of conditional structure (such as #IF or #CASE). If you need to conditionally generate the code, place the #IF or #CASE structure within the #ATSTART structure. **Example:** **#CONTROL(BrowseList,'Add Browse List controls')** ** ****#ATSTART** **  #FIX(%Control,%ListBox)** **  #DECLARE(%ListPre)** **  #SET(%ListPre,'List' & %ActiveTemplateInstance & ':') ** **                        #!Makes %ListPre contain "List#:'** ** #ENDAT** ** #AT(%DataSectionBeforeWindow)** **%ListPre:Scroll  LONG      !Scroll for %Control** **%ListPre:Chioce  LONG      !Choice for %Control** ** #ENDAT** **See Also:**     [[ procedure begin a procedure template .htm|#PROCEDURE]] , [[ code define a code template .htm|#CODE]] , [[ control define a control template .htm|#CONTROL]] , [[ extension define an extension template .htm|#EXTENSION]]