| **Navigation:**  [[templates.htm|Templates]] > [[tlrcontents.htm|Template Language Reference]] > Complete Alpha Listing >====== #ALIAS/#TRYALIAS (access a symbol from another instance) {{c6h0068.jpg|C6H0068.jpg}} ====== | [[ add add to multi valued symbol .htm|{{btn_prev_n.gif|Previous page}}]][[tlrcontents.htm|{{btn_home_n.gif|Return to chapter overview}}]][[ append add to source file .htm|{{btn_next_n.gif|Next page}}]] | | || **#ALIAS(** //newsymbol// , //oldsymbol// [, //instance// ] ) **#TRYALIAS(** //newsymbol// , //oldsymbol// [, //instance// ] ) {{blk2blue.jpg|blk2blue.jpg}} | **#ALIAS / #TRYALIAS** | Declares a synonym for a user-defined symbol. | | //newsymbol// | Specifies the new synonym for the //oldsymbol//. | | //oldsymbol// | The name of the symbol for which to declare a synonym. This must meet all the requirements of a user-defined symbol. This must not be a #PROMPT symbol or a variable in the same scope. | | //instance// | An expression containing the instance of the addition containing the //oldsymbol//. | The **#ALIAS** statement declares a synonym for the user-defined //oldsymbol// declared in a #CODE, #CONTROL, or #EXTENSION template prompt for use in another. The **#TRYALIAS **statement is similar to **#ALIAS **except that the symbol is only defined by the template referred to by //oldsymbol//. If //oldsymbol //is not defined, no template error is posted. **Example:** **#EXTENSION(GlobalSecurity,'Global Password Check'),APPLICATION** **  #DECLARE(%PasswordFile)** **  #DECLARE(%PasswordFileKey)** **#EXTENSION(LocalSecurity,'Local Procedure Password Check'),PROCEDURE** ** ****#ALIAS****(%PswdFile,%PasswordFile,%ControlInstance)** ** ****#ALIAS****(%PswdFileKey,%PasswordFileKey,%ControlInstance)** **#GROUP (%QueryHasLocator, %WhichInstance),AUTO** **#TRYALIAS**** (%CurLocatorType, %LocatorType, %WhichInstance)** **#IF (VAREXISTS(%CurLocatorType))** **  #RETURN (%CurLocatorType)** **#END** **#RETURN ''** **See Also:     **[[ code define a code template .htm|#CODE]] ,[[ control define a control template .htm|#CONTROL]] ,[[ extension define an extension template .htm|#EXTENSION]]