User Tools

Site Tools


alias_tryalias_access_a_symbol_from_another_instance_.htm
Navigation:  Templates > Template Language Reference > Complete Alpha Listing >====== #ALIAS/#TRYALIAS (access a symbol from another instance) C6H0068.jpg ====== Previous pageReturn to chapter overviewNext page

#ALIAS( newsymbol , oldsymbol [, instance ] )

#TRYALIAS( newsymbol , oldsymbol [, instance ] )

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 ,#CONTROL ,#EXTENSION

alias_tryalias_access_a_symbol_from_another_instance_.htm.txt · Last modified: 2021/04/15 15:56 by 127.0.0.1