<@VAR>Syntax <@VAR NAME=name
[SCOPE=scope] [FORMAT=format]
[APREFIX=aprefix] [ASUFFIX=asuffix]
[RPREFIX=rprefix] [RSUFFIX=rsuffix]
[CPREFIX=cprefix] [CSUFFIX=csuffix]
Description<@VAR> retrieves the contents of a variable, and, depending on the operation being performed, formats the data appropriately. Any of the attribute values of <@VAR> may be specified by other meta tags. ScalarsWhen retrieving the contents of a scalar (standard variable), the result of <@VAR> is always a text string. Arrays<@VAR> may also be used to retrieve an array. However, <@VAR> does different things to arrays based on context: <@VAR> converts the array to text whenever the result of the tag is returned in Results HTML, or when TYPE=text is specified; <@VAR> returns an internal reference to the array when it is used to copy an array from one place to another. So, if <@VAR> is used within <@ASSIGN>, then no conversion to text is performed (unless the TYPE="text" attribute is specified). The format outputted is specified by the following attributes: APREFIX: the array prefix string
For more information, see "aPrefix", "aSuffix" , "cPrefix" , "cSuffix" , "rPrefix" and "rSuffix" . These attributes are used for defining the appropriate text for display, before and after the specific components of the array are displayed. This is useful for automatically displaying the contents of arrays as tables or ordered lists. The default values of these attributes are set by configuration variables with the same name. Scoping RulesScoping is the method by which variables can be organized and disposed of in an orderly and convenient fashion. There are various levels of scoping, each of which has an appropriate purpose: For more information, see "Configuration Variables".
For more information, see "domainScopeKey".
For more information, see "userKey, altuserKey".
Specifying ScopesThere are two methods of specifying a variable with a particular scope.
Behavior is undefined when both methods are used at once. Scoping PrecedenceWhen no scope is specified, Tango must find the variable by looking for the variable name within the various scopes. Tango has a set order in which it tries to find scopes. They are: local--»user--»domain--»system
For more information, see "domainScopeKey". If domainScopeKey resolves to empty for this user, then domain is not checked. Variable Shortcut SyntaxThere is a shortcut syntax for returning variables as well, with or without scope: use a double "@" and the name of the variable. The following two notations in each of the examples are equivalent: <@VAR NAME="homer" SCOPE="domain">
Configuration VariablesFor a detailed list of configuration variables, see Chapter 2 of the Meta Tags and Configuration Variables manual. Tango reserves special variables that contribute to the configuration of the server and also that provide default behaviors for users. For more information, see "About Variables" in Chapter 7 of the User's Guide. For more information on setting configuration variables using the config.taf file, see "Tango Server Configuration File" in the User's Guide. System variables that contribute to the basic configuration of the server only exist in the system scope. System variables that provide default behaviors for users are subject to the full scoping mechanism described previously. Default values read from the preference file are stored in the system scope. Examples <@VAR NAME="foo" SCOPE="local">
<@VAR NAME="foo" SCOPE="user">
Accessing a system scope variable: <@VAR NAME="foo" SCOPE="system">
Accessing a domain scope variable: <@VAR NAME="foo" SCOPE="domain">
Accessing variable using scoping precedence: Getting an array and formatting it for Results HTML: Getting part of an array and formatting it for Results HTML: Getting an array and formatting it for Results HTML with attributes: <@VAR NAME="array" APREFIX='<TABLE BORDER="2">' ASUFFIX= </TABLE>' RPREFIX='<TR>' RSUFFIX='</TR>' CPREFIX='<TD BORDER="2">' CSUFFIX='</TD>'> Copying an array without formatting it: <@ASSIGN NAME="array2" VALUE="<@VAR NAME='array'>"> Copying part of an array without formatting it: <@ASSIGN NAME="array2" VALUE="<@VAR NAME='array[*,4]'>"> Copying the formatted representation of an array to a variable: <@ASSIGN NAME="array2"
VALUE="<@VAR NAME='array'
See Also |
Copyright © 1998, Pervasive Software Inc. All rights reserved.