There are several different types of variables which can be included in RES-Reach template or "NBT" files; some of these have group names which can be used to resolve name ambiguities.
|
Variable Type |
Group Identifier |
Variable Names |
When Applicable |
|
Form input variables |
_FRM |
specified in HTML for the form used to call this NBT file. Imagemap and input type image variables will have 2 variables, with the postfix ".x" and ".y", to transmit which pixel was clicked. There is no distinction made between GET and POST queries. |
When sent by referring form. Visible throughout the NBT file. For multiple-valued variables, iterate through the values using <RECORD Name=VarName> Imagemap and input type image variables will have 2 variables, with the postfix ".x" and ".y", to transmit which pixel was clicked. There is no distinction made between GET and POST queries. |
|
Current query |
_DAT |
TotalRows, DBQ, RO, EX |
Within <DATA></DATA> , except action queries. The value of "TotalRows" is very unreliable (often "-1") except after the </RECORD> tag. "DBQ" contains the name of the database. RO is "1" if the mode is READONLY, "0" otherwise. "EX" is "1" if the mode is EXCLUSIVE, "0" otherwise. |
|
Current record |
_REC |
[Alias.Field Name], RecNo |
Within <RECORD></RECORD> |
|
Run-time variables |
_RUN |
ErrNo, ErrString, LIBS, WAIT |
ErrNo and ErrString refer to the last error; LIBS must be set before calling a library function; and WAIT indicates the number of milliseconds to try an operation on a global variable or to wait for the results of an external function or program call. |
|
HTTP, CGI, and Server Environment Variables |
_ENV |
REQUEST_METHOD, SERVER_NAME, SERVER_PORT, REMOTE_ADDR, REMOTE_USER, CONTENT_TYPE, CONTENT_LENGTH, HTTP_USER_AGENT, REFERER, etc. Also most environment variable values in the RES-Reach server's environment. |
Set by the Web server |
|
Program functions |
_SYS |
Date, Time, Version, Unknown, ThreadCount The Unknown program variable has the value of the "Unknown" profile variable if it it exists. Otherwise, it has the value "???". ThreadCount contains the number of template files being executed by the RES-Reach service. |
Always. |
|
Profile settings |
_INI |
for example, CALL_NBT, GET_NBT, DB, UNKNOWN, or any other variable can be defined |
Set by [VARIABLES] section of NETBASE.INI file. |
|
Private variables |
_PRI |
Any variable can be defined for use within a single RES-Reach template. |
Created using the <SET> tag, these variables are assigned values in the NBT file and disappear when the template interpretation is finished. |
|
Public variables |
not applicable |
Any variable can be defined for use by several different RES-Reach templates. |
Created using the <SET> tag, these variables last as long as the RES-Reach programmer specifies. They are accessible by any template file which knows of their existence. |
|
File name with variable replacement |
not applicable |
@filename Special pseudo-variables beginning with "@" indicate file names. The contents of the file, found in the NBT Root directory, are inserted into the stream and variable replacement is performed on the contents of the file. For example, {@MALL/RES/CATALG01.ENG} specifies that the file named "CATALG01.ENG" should be found in the "MALL/RES" sub-directory off the RES-Reach root and included in the RES-Reach template being processed. |
Always. |
|
File name without variable replacement |
not applicable |
@@filename Special pseudo-variables beginning with "@@" also indicate file names. The contents of the file, found in the NBT Root directory, are inserted into the stream but variable replacement is NOT performed on the contents of the file. For example, {@MALL/RES/CATALG01.ENG} specifies that the file named "CATALG01.ENG" should be found in the "MALL/RES" sub-directory off the RES-Reach root and included in the RES-Reach template being processed. |
Always. |
It is possible for variables from a form input field, a profile setting, and an HTTP variable to have the same name. The precedence is as follows:
In other words, when a group prefix is NOT supplied, the search order of groups during variable replacement is _PRI, _ENV, _FRM, and _INI. _DAT, _REC and _SYS groups rank with the _ENV group. To circumvent the variable precedence rules when looking for the value of a variable, prefix its name with the group identifier.
4.1.1.1 Notes on Variables