#DECLARE

#DECLARE( symbol );

symbolThe name of the template variable.

The #DECLARE statement declares a user-defined symbol for use in the template. The symbol is simply created and not initialized to any particular value, therefore it may be destined to contain either string or numeric data. This creates a Template Symbol that can then be used in other Template Language statements (such as #SET and #APPEND).

Unlike #UNIQUENAME, which generates a unique name automatically, #DECLARE only declares a template symbol with the name provided and does not itself generate a unique ECL identifier. If that symbol is later assigned and used to generate ECL, the caller is responsible for avoiding name collisions, which is especially important when using #DECLARE inside a MACRO structure that may be called multiple times in the same scope.

Example:

#DECLARE(MySymbol); //declare a symbol named "MySymbol"
#SET(MySymbol,11); //initialize MySymbol to 11
OUTPUT(%'MySymbol'%)

See Also: #SET, #APPEND, #UNIQUENAME