Variables:  Declaring and using
Page Links Quick Variable Reference, Variable storage types, LifeCycle, Naming variables, Declaring, Automatic variables, Variable Prefix Chart, TEDECLARE Tag, TESET Tag, Task. Variables, Screen. Variables
Variables in templates enable the template author to provide a holding place for constant data as well as data originating from the web or from a host screen.  All variables in templates are public in scope, meaning that if the name is known, any template script can read or write a variable value.  While the scope is public, how a variable is referenced (what you use as its name) depends on where it has been declared and from where it being referenced.

Variable Storage Types

Variables defined using a <TEDECLARE VAR> tag can have one of two instance scopes.  The term instance scope refers to "how may copies" of the variable will exist in an active host emulation server.  The most common is the session instance, where each active host session has its own copy of the variable value. This is also commonly referred to as a state variable since the "state" of the variable is maintained for the user or co-server session between requests.

To support many common requirements in server-based environments, however, the server instance is provided; with the server instance scope, each variable has only one copy per server.  Server-instance variables are identified in both expressions and <TEDECLARE VAR> tags by the special prefix "Server."   An example of a server-scoped variable is "Server.QuoteOfTheDay".

New with Version2 of ScreenSurfer is a special variant of the Server Scope variable, called the Constant. A constant is declared like a normal variable, and is used as a variable, but can only be initialized in the TEDECLARE statement. In your SurferScript expressions, the constant variable is read-only and cannot appear on the left side of a TESET tag. Constant variables are defined using the prefix constant. so that all references to the constant variable start with constant, such as "Constant.StateCodes".

Constant variables offer the storage efficiency of server-scope variables without the minor performance penalty of global variables (each access for read/write of a server-scope variable requires a lock on the global/server variable dataspace). In addition to runtime efficiency, another advantage of constant server-scope variables is that they may be maintained in a controlled template file and thus any use of constant-scope variables can be assured to be unaltered by any SurferScript during execution.

Life Cycle of a Session Variable

A session variable is initialized when a session is established (using the CONNECT URL or the TEACTION CONNECT tag). At this time, if no "DATA" attribute is defined for the variable in the TEDECLARE tag, the variable is set to 0 (zero) if numeric and "" (empty string) if text. If a DATA attribute is defined in the TEDECLARE tag, at session initialization the variable is given the DATA attribute value.

The connection between a user at a browser, a Cold Fusion Session or an ASP session is the SessionKey value, which includes an identifier that "points" to the session (think of it as the "state management key"). Anytime during the session, the variable value may be changed using the TESET Tag, and the new value will persist on through to the next time the value is changed or until the end of the session.

A session persists from initialization on through to the end of the session ("EXIT" URL or TEACTION RELEASE tag executed), at which time the variable is destroyed as the "memory" heap for the session is released for use by the system.

Naming: Template-Declared Variables

A template-declared variable is one which is declared either at the top of the template file (preferred) or in-between two sections.  The fully qualified name of a template variable consists of TemplateName.VariableName.

Naming: Section-Declared Variables

A section-declared variable is one which is declared inside a section (in-between a <TESECTION> tag and a following </TESECTION> or <TESECTION>).  The fully-qualified name of a section variable consists of TemplateName.SectionName.VariableName.

Using Partial and Fully Qualified Names

A variable can be referenced in an expression with no qualification  when it is a template variable and is declared in the same template, or when it is a section variable and declared in the same section.   At any location, a variable may be referenced using its fully qualified name, regardless of where it is declared.  A section variable may be referenced with a partial qualification if it is declared in another section in the same template file.  In this circumstance, the form SectionName.VariableName may be used.

Special Variable Prefixes

There are special prefixes which may be used in expressions to identify web variables, Http variables, screen (session) variables, environment variables and global variables; these are identified in the variable reference chart.

Declaring variables

You declare variables with the <TEDECLARE VAR> tag.  This tag can appear anywhere in a template file.  When it occurs outside of any <TESECTION> tag, it belongs to the template.  When it occurs inside a section, it belongs to that section's name space.  When it is fully-qualifed in the <TEDECLARE VAR> using the prefix "server.", it belongs to the global name space.

Automatic Declarations

An automatic declaration of a variable occurs when a reference is made to a variable and there is no <TEDECLARE> in the name space for that variable.  When this occurs, the variable has the same naming rules as for a section variable, and has a type (Text, Float or Integer) which is based on the first expression in a <TESET where that variable is an "LVALUE" (left value).

Note that with Version 2 of ScreenSurfer, there is a special registry setting, "Variable Definitions Required" which when set to "Yes" will cause a warning any time a variable is not explicitly declared in a TEDECLARE tag.

DataBase and Result Variables

Two other classes of variables, each of Session Scope are the database fetch and resultset variables.

Database fetch variables are automatically defined based on the SELECT statement in a TEDECLARE DBSELECT tag. The names of the variables depend on the SELECT statement used, and the target database tables. Anytime you are not sure of the variables that result from a SELECT, compile your templates with trace, start a single host access session in the Console, then click on the "StateData" link in the Sessions details line. The StateData will display all the defined variables for the session, including all the names created during the compile of any SELECT statements.

Result set variables are defined as other variables in a TEDECLARE statement, only using the "ROW" declare type instead of "VAR". Result-set variables are always session-scope and can be read and written as other variables, except that the naming scope is always RowName.VariableName. You don't prefix a result set variable with a template or section name, as result sets always are given a name that is for all accessing templates, not just the template that declared the result set.

Variable Reference Summary Chart

The following table summarizes naming patterns for template variables and special data sources which may be used in expressions as if they are variables.
 
Prefix  Data Source Valid Uses Comments
Env. Environment Data Read The current process environment space is queried for a named item matching the text following the "Env.".  This enables global customization at the system level of such entries as server name, target web server and so on.
Web. Web Data Read Any value passed in using name-value pairs on an HREF or form ACTION attribute, or values in an HTML form is accessed using the web. prefix. This is really not an actual variable, but is instead a "method call" to the read function for active HTTP values. Values are available when the current web browser entry action contains a data item with a name matching the text following the "Web." (either a name-value pair in the URL or a named data item in an HTML form). Otherwise, will be empty string.
Web.Cookie_ Web Cookie Data Read Any value passed in from a cookie will be given the web.cookie_ prefix. See the function SetClientCookie function for information on how to set, update and clear user cookies.
Task. Task (HTTP "hit") Request Variables Read/Write Internal Task variables provide the developer with access to active values in an easy to use manner. Typically read-only, but some are also capable of being written. For more information see the Special Task Variables Section. 
Server. Global Variable Declare / Read/Write Global variables can be used anywhere session variables are used, however there is a single copy for the server process.  These variables are typically initialized in the <TEDECLARE VAR> tag and used as a convenient way to customize constant or status data values in a single location across all sessions.
Screen. Internal Session Variable Read/Write Internal session variables provide the developer with access to active values in an easy to use manner. Typically read-only, but some are also capable of being written, such as Screen.CursorOffset. For more information, see the Special Screen Session Variables Section. 
DBSelectName. ODBC Fetch Data Read/Write ODBC Fetch data variables are automatically generated by the <TEDECLARE DBSELECT> statement.  They are always referenced using the DBSELECT name as the prefix, followed by the column name of the selected data item. 

Each set of DBSELECT variables are written/set by a <TEFETCH> tag.  Writing to these variables in a <TESET> is allowed, which may be useful as part of error-recovery or operating when the database is unavailable.

RowName. Logical Row of Variables Read/Write Row variables are defined in a <TEDECLARE ROW> statement.  They are always referenced using the ROW name as the prefix, followed by the column name of the selected data item.

Each "column" in the Row is declared using the same syntax as for standard variables (Text, Integer and so on). Variables declared in a Row are always Session variables but have a global naming scope (you don't prefix the name of a row variable with any other tokens/names). The Row variable type is required for returning data to a ColdFusion or Java Client as described in ColdFusion and Java Clients, using the <TERESULT> tag.

No prefix Session Variable Declare / Read/Write Session variables declared in the current section.

SectionName.
Session Variable Declare / Read/Write Session variables declared in any section of the current template.
Template.SectionName. Session Variable Declare / Read/Write Session variables declared in any section in any template.
 


TEDECLARE Declare a template variable, type and initial data

<TEDECLARE VAR NAME="Name" [TYPE="TEXT | TEXT-NOBREAK | INT | FLOAT"] [LENGTH=N] [DATA="initial value"]>

Declare an object in the current template (click here for other uses of TEDECLARE).  Currently only variables may be declared, but other classes may be introduced in the future.  Syntax supports each parameter by position, or in any order if the name=value form is utilized.  For example, the following three definitions are all valid afd equivalent:
 


Other Uses of TEDECLARE

For use of <TEDECLARE> in the definition of ODBC DataSources and SELECT statements, see:  <TEDECLARE DBSOURCE> and <TEDECLARE DBSELECT> statement descriptions in the Querying Data with ODBC section.


TESET Change the value of a template variable

<TESET NAME= expression>

Used to change the value of a variable.  Note that you can use "typical" expressions as with those found in the BASIC language to perform math and other operations.  Numeric operations supported include addition, subtraction, multiplication and division.  Inferred precedence is fully supported (multiplication and division is performed prior to addition/subtraction) as is explicit precedence (the use of parenthesis to assure an operation is carried-out in an atomic fashion).  For example, 2+3*2 will equal 8 while (2+3)*2 will equal 10.

Text expressions only support the addition operator:  subtraction, multiplication and division are undefined.

Internal Variable Quick Reference

ScreenSurfer includes many reserved, internal variables that provide information about a user's session as well as provide control and customization functionality. These variables are summarized in the following chart by type.
Variable Quick Reference
This chart contains the current variable set for ScreenSurfer, organized by type. Click on a variable for a more detailed description.
HTTP Request

Task.BrowserLevel - Mozilla level of browser

Task.BrowserType Netscape, MSIE or other

Task.HttpCache - Set to false for NOCACHE

Task.HttpAgent - Complete browser type

Task.HttpReferer - Referring URL

Task.HttpReferrer - Same thing spelled right!

Task.HttpURL - Active HTTP URL

Task.ClientType - HTML or RPC (CF, ASP)

Task.ClientAddr - IP Address of client

Task.Handler - "default" or redirect name

Task.MimeType - text/html, text/xml or ?
Screen Information
Screen.5250Status - Message Waiting, Attention

Screen.ActiveScreen - TemplateName.ScreenName

Screen.Columns - Number of screen columns

Screen.CursorRow - 1 based

Screen.CursorColumn - Cursor column 1 based

Screen.CursorOffset - 0 based from start

Screen.CursorPos - Same as Offset

Screen.Rows - Number of screen rows
User Information
Screen.ActiveUser - User IP or your name
Screen to HTML Control
Task.AidText - AID key user selected

Screen.FieldID - For multiple data entry screens

Screen.PageCount - Number of HTML pages displayed

Screen.Secure - Controls bouncing to SSL

Screen.SecureMachineName - SSL Machine address

Screen.SelectClicks - Set to one for selectable fields

Screen.SendKeysToAny - For simple applications

Screen.SessionKey - State and session manager

Screen.SessionID - Current session number

Screen.SilentReconnect - Suppress reconnect message

Screen.SilentSynchErr - Suppress out-of-synch message

Screen.SynchJava - Use Java applet to synch

Screen.SynchScript - Use Javascript to synch

Screen.SynchWait - Milliseconds to wait during synch

Screen.UpdateTicks - Last host update time
HTML Formatting
Screen.EntryBetween - Replace space between entries

Screen.EntryBorderWidth - Pixels used for entry border

Screen.EntryCharWidth - Pixels per font character

Screen.EntryHeight - Pixel height for entry field

Screen.EntryLeadingBold - Replaces leading blank

Screen.EntryLeadingNorm - Replaces leading blank

Screen.EntrySizeAdjustBold - Only if CSS won't work

Screen.EntrySizeAdjustNorm - Only if CSS won't work

Screen.EntryTagTextBold - Extra HTML for INPUT

Screen.EntryTagTextNorm - Extra HTML for INPUT

Screen.EntryTrailingBold - Replaces trailing blank

Screen.EntryTrailingNorm - Replaces trailing blank
Host Connection
Screen.ActiveLU - Host LU Name

Screen.EntryStart - For TTY 3270 mode

Screen.GroupName - Session's LU_GROUP_n

Screen.HostStatus - Session's Connection status

Screen.IdleTime - How long since host write

Screen.IsEmpty - Check for empty screen

Screen.MaxResponseTime - Longest transition

Screen.Protocol - 3270 or 5250

Screen.ResponseTime - Last transition time

Screen.ScreenID - Last recognized screen
Screen Transitions
Screen.DefaultReadyState - Transition logic

Screen.HostWritesExpected - Tune next transition

Screen.IgnoreNonWrites - Tune transition

Screen.ReadyID - Result of recognition

Screen.SettleTime - Tune transitions

Screen.TimeOut - Default is 20 seconds
Control and Error Handling
Screen.UserErrors - When 1 errors don't break logic

Task.UserErrors - When 1 errors don't break logic

Task.SessionActive - 1 if session active

Task.SessionRequired - User Flag for connection scripts

Task.ErrorCode - Active Error RetCode

Task.ErrorComponent - Error caused-by name

Task.ErrorLine - Error file Line #

Task.ErrorSection - Section in which error occurred

Task.ErrorText - Active error description

Task.WebWritten - 1 if screen's been updated



Special Task Variables Provide access to client-request internal values

Special Task variables all start with the prefix "Task.", and provide SurferScript expressions with access to current HTTP status information in an easy-to-use fashion.
 

See Task.HttpAgent for full browser type information (Task.BrowserType is derived from Task.HttpAgent).

Variable Use Description
Task.AIDText  Read Provides text of the current AID key as entered by the user at the web browser. Examples include "[enter]", "[pf1]" and "[pf8]". This is updated prior to the <TEEVENT WEBINPUT> section being executed (if the active screen section has a WEBINPUT event coded. By interrogating this value in the WEBINPUT section, logic can prepare the next screen transition to accomodate multiple host buffers, or can implement the use of a <TEACTION WAITFOR> in order to provide a solid screen transition.
Task.BrowserLevel  Read This value relates to the "Mozilla" level of the current browser. This is not the browser version, which is contained in the Task.HttpAgent variable. The Task.BrowserLevel is a good measure of the general level of compatibility for the browser, as most browsers indicate a general level of compatibility using the "Mozilla" prefix. If the user agent HTTP field does not start with Mozilla, this value will be zero.

See Task.HttpAgent for full browser type information (Task.BrowserLevel is derived from Task.HttpAgent).

Task.BrowserType  Read This value will be "Netscape" for a Netscape browser, MSIE for Microsoft Internet explorer. It relates to the "Compatible" field for the current browser so for other browsers will only contain a value if the browser includes the "compatible" token in the agent field.
Task.ClientAddr  Read/Write Provides text of the client's Internet Protocol address (IP Address). This can be used in high security environments to validate that the client is authorized to access the current block of SurferScript or representitive host functionality.
Task.ClientType  Read/Write Provides text of current connection type; "html" for standard browser, and "rpc" if a ColdFusion, ASP or other co-server client. In numeric expressions, returns 1 for html and 2 for rpc client types.
Task.ErrorCode  Read/Write Provides access to the "RetCode" value returned to Co-Servers in the Status recordset (ASP) or _Status Query (ColdFusion). May be set in script to indicate a particular type of error to the caller. Also useful in the Global.ScriptError section for reporting error details.
Task.ErrorComponent  Read/Write Provides text of any error component in the current stream of SurferScript. The error component provides an internal identification of where an error has occurred. This value is empty (null) when no error condition exists. If you are handling an error created by a TEDBEXEC, TEFETCH or TEACTION tag using Screen.UserErrors=1, you can prevent further action by ScreenSurfer on an error by setting this value to an empty string ("") in your error handling logic.
Task.ErrorLine  Read Provides the line number in the .STML file containing the originating script for the error. If -1, the active error occured in logic not directly related to a user script tag. Useful in the Global.ScriptError section for reporting error details.
Task.ErrorSection  Read/Write Provides the name of the Surferscript section executing at the time of an error. Useful in the Global.ScriptError section for reporting error details.
Task.ErrorText  Read/Write Provides text of any error message in the current stream of SurferScript. The error message provides details on any outstanding error. This value is empty (null) when no error condition exists.
Task.Handler  Read/Write Each HTTP hit sets this to "default". By changing to another value, you can signal a calling co-server component in ASP or Cold Fusion environments that "this isn't a default pass-through anymore!". This was added to enable the functional movement in and out of a default.asp page.
Task.HttpAgent  Read/Write Provides text of current browser "agent" as reported by the requesting HTTP client. Note you can interrogate and analyse this text string at initial connect time (maybe on the "logon" screen section). By doing so and setting session variables (like "JavaScriptSupportLevel") you can customize your output based on the user's browser. The variables Task.BrowserLevel and Task.BrowserType are both derived from this value.
Task.HttpCache  Read/Write Boolean value which determines if the current "HIT" should have the HTTP protocol indicate to all proxies and browsers whether the current page should be cached or not. By changing this value to "false", you will include an HTTP header in the outbound stream which will cancel caching for the current page. Note that for a complete implementation of a "cache-kill", you will also need to include the HTTP pragmas in your HTML--such as:
<META HTTP-EQUIV="Pragma"
     CONTENT="no-cache">
<META HTTP-EQUIV="Expires"
     CONTENT="Thu, 01 Jan 1980 00:00:00 GMT">

Task.HttpReferrer/Task.HttpReferer  Read/Write Provides text of current browser "referer" URL, which is the URL "from which this page came". This is not going to be too useful except for initial "home page" information. You can change this to some other string, like the active host screen or function, and if HTTP logging is active you can get some better information into the logs.
Task.HttpURL  Read/Write Provides text of current browser GET or POST request, also know as the URL (Universal Resource Locator) of the current HTTP hit. Depending on the application, this may be meaningful, or may be a cryptic request for the ScreenSurfer internal "/SURFER/EMULATOR" command. Many ScreenSurfer customers set this value to the current screen name in their templates, so that in the HTTP log it is possible to see which host screens users are viewing.
Task.MimeType  Read/Write MIME type returned to the calling agent for the active HTTP hit. For XML queries, change this to "text/xml". Each HTTP request (hit) resets the value of Task.MimeType to "text/html" prior to the start of SurferScript execution.
Task.SessionActive  Read Provides an easily accessed indicator of whether or not the current section of SurferScript is connected to a session. If NOT active, will return a 0 in a numeric expression and a "false" to a text expression. If a session is active, will return a 1 to a numeric test and a "true" to a text test. Use this in transactions that may be re-submitted by the user following a <TEACTION RELEASE> that would invalidate the session keys in the page the user is resubmitting.
Task.SessionRequired  Read/Write Provided as a convenient variable to use as a flag for connection scripts, where a common script is used to connect and get a session, but no session variables can be used as flags for whether an existing session is required.
Task.UserErrors  Read/Write Same as Screen.UserErrors, but preferred since using the Task. variables can be achieved with or without an active user session. Particularly useful during TEACTION CONNECT or TEACTION GETSESSION to suppress scripts terminating due to an error.
Task.WebWritten  Read/Write Provides an easily accessed indicator of whether or not the current HTML form data has been written to the screen. Typically used in conjunction with the <TEACTION WEBTOSCREEN> tag. Can be reset to 0 to enable more than one use of <TEACTION WEBTOSCREN>.


Special Screen Session Variables Provide access to internal values

Special Screen session variables all start with the prefix "Screen.", and provide ScreenSurfer templates with access to current status information in an easy-to-use fashion.
 
Variable Use Description
Screen.5250Status  Read Returns active 5250 status information. This is a two character text string, which is as follows:
OffsetValueMeaning
0" " (blank)No Message Waiting
0"M" Message Waiting
1" " (blank)No Alarm
1"A" (blank)Alarm
Screen.ActiveLU  Read/Write (103 chars) Contains the active LU name for the current session. For SNA or TN3270E connections, this is the LU assigned by the pool or directly requested. For TN3270, this will simply be the target host for the connection.

This value appears in the Console Status displays as "Active LU". By changing this to another value, such as the active user's telephone number, you can improve the ability of the help desk to work with user problems.

Screen.ActiveScreen  Read  Provides fully qualified text string (template.section) of screen section currently executing. While this may seem redundant (any code inside a section should know where it is!), it enables the use of single-line error handling code that can be quickly copied into all sections quickly. For example:
<TESET ErrorSection=Screen.ActiveScreen> <TEPUTSECTION global.myerrordisplay>
Screen.ActiveUser  Read/Write (19 chars) At CONNECT time, the IP address of the connecting HTTP client is copied to this session variable. This will then be active for the duration of the session.

This value appears in the Console Status when a session has a connected user. By changing this to another value, such as the active user's name, you can improve the ability of the help desk to work with user problems. This value is also written to the HTTP log in the "login name" value.

Screen.Columns  Read Returns an integer representing the number of columns on the active screen. Typically 80, but for alternative screen sizes can different (such as 132).
  Read/Write  Provides integer value of current cursor column (base 1), when you make Screen.CursorColumn the left value in a <TESET>, it will change the cursor column position without changing the row (like a move left or right). 
Screen.CursorOffset  Read/Write  Provides integer value of current cursor offset (base 0), when you include as the left expression in a TESET, you change the active session's cursor location 
Screen.CursorRow  Read/Write  Provides integer value of current cursor row (base 1), when you make Screen.CursorRow the left value in a <TESET>, it will take the current cursor column and maintain it, while changing the row (like a up/down only to an exact row) 
Screen.DefaultReadyState  Read/Write This variable represents the default screen transition logic to apply to entering one screen and waiting for the next screen to be ready. It is a tuning option, which in general should only be changed on the advice of ScreenSurfer SupportCenter personnel following an analysis of your host's protocol datastream. For individual screen transitions, the active ready state can be overridden by the TEREADYWHEN tag. Following an override, this value is restored for the next screen transition.

This variable is initialized at session CONNECT to "IgnoreEmptyWrites" which prevents unwanted screen transitions in certain TN3270 and TN3270E environments.

Possible values and their meanings:
Recognition At the end of a screen update, the screen displayed must be a screen in the active recognition base (must be a screen identified in a TESECTION). This is recommended for procedural environments where all screen navigation is performed on behalf of the user and only "known" screens are to be processed.
IgnoreEmptyWrites When receiving a buffer with just a write command but no data, ignore it as a screen unlock
UseEmptyWrites All buffers that contain an unlock and are in a buffer with END BRACKET (SNA) or END OF RECORD (TN3270/TN3270E) should be recognized as a screen unlock
StrictBufferCount Count records (TN) or brackets (SNA), with 1 always being the default.

Screen.EntryBetween  Read/Write  This text defines what appears between two entry fields when they only have one space between them (on the screen, the two fields are as close to each other as individual fields can get, since there is an attribute byte between them).

Typically, in order to achieve perfect alignment, this would contain something like "<img src="p.gif" width="2">. The width of the transparent gif will depend on the active font character width.

Screen.EntryBorderWidth  Read/Write  The Entry Border Width is a single number which represents the number of horizontal pixels required for the target default browser to draw an input field. Typically, for IE this is 6 and for Netscape it is 8.

This value corresponds to the registry entry Entry Border Width which may be used to provide the default value if all users of the ScreenSurfer server use the same browser.

Note that this value is ignored unless the value "Screen.EntryCharacterWidth" is non-zero.

Screen.EntryCharWidth  Read/Write  Used to calibrate entry field sizes. Currently only recommended for use with Internet Explorer, because Netscape 4 ignores the input field "Style" property, and Netscape 4.5 mis-handles width and height settings.

Corresponds to the Entry Character Width registry setting which may be used to provide the default value if all users of the ScreenSurfer server use the same browser.

When this value is non-zero, ScreenSurfer will set the width of each entry field generated in a TEAREA or TEDATA tag to FieldSize * Screen.EntryCharacterWidth + Screen.EntryBorderWidth (see above), and then set the exact size of the current entry field using a Style property.

See also Screen.EntryBorderWidth and Screen.EntryHeight.

Screen.EntryHeight  Read/Write  Used to set the active entry field height, in pixels. This setting should be large enough so that the active font still displays underscores... Only used if Entry Width is non-zero.

Corresponds to the Entry Height registry setting which may be used to provide the default value if all users of the ScreenSurfer server use the same browser.

Screen.EntryLeadingBold  Read/Write  Please see the "Screen.EntryTrailingBold" setting, described below...this is the same thing, only for the space preceeding the entry field.
Screen.EntryLeadingNorm  Read/Write  Please see the "Screen.EntryTrailingNorm" setting, described below...this is the same thing, only for the space preceeding the entry field.
Screen.EntrySizeAdjustBold  Read/Write  Since many browsers, including Netscape, do not properly support style-based field widths and heights, this setting is provided to adjust the size of an entry field in an attempt to reduce the on-page width. Typically, this might be -1 for Netscape in order to reduce field widths. Note that in many environments, bold fonts will NOT need an adjustment while normal fonts (see below) do!
Screen.SizeAdjustNorm  Read/Write  Please see above setting for Screen.EntrySizeAdjustBold...
Screen.EntryStart  Read/Write  Provides integer value of current start of entry-capable area for an unformatted display. When you include as the left expression in a TESET, you change the active session's start location for entry fields on an unformatted screen.

This is handy for circumstances where the unformatted display is fine for use, but displays an entry field that starts too high or too far to the left on the screen.
Screen.EntryTagTextBold  Read/Write  Set this variable to any additional HTML you would like to generate for each entry field that is bold highlighted. For example, you can request that the entry field be of a particular style class by setting to 'class="EntBold"'.
Screen.EntryTagTextNorm  Read/Write  Set this variable to any additional HTML you would like to generate for each entry field that is normal highlight. For example, you can request that the entry field be of a particular style class by setting to 'class="EntNorm"'.
Screen.EntryTrailingBold  Read/Write  This value is used to customize entry field calibrations-- it is used in conjunction with the Screen.EntryCharWidth and Screen.EntryBorderWidth settings described above. To implement "perfect" entry field alighment, you replace the single space defined here with HTML to define a clear .GIF file. This value corresponds to the Space After Entry HTML (Bold) registry setting.

This value applies to BOLD fields, which enables you to define a GIF that might "highlight" the active field by implementing a RED or YELLOW line right next to the field...

Since this setting is highly browser-dependent, it is usually not set as a default except in installations where browser configurations are tightly controlled and a default makes sense.

Example: <img src="boldright.gif" width="4">

Screen.EntryTrailingNorm  Read/Write  This value is the same as for Screen.EntryTrailingBold, only this value applies to NORMAL fields, which enables you to define a GIF that is possibly different than that defined for bold fields, such as a clear (transparent) one...

Since this setting is highly browser-dependent, it is usually not set as a default except in installations where browser configurations are tightly controlled and a default makes sense.

Screen.FieldID Read/Write This is a single-character text value that is reset to "_" (underscore) each time a host screen transition is initiated (either by the user entering at the web browser, or an action such as <TEACTION ENTER> is executed). All fields generated in the <TEAREA> and <TEDATA> tags start with the letter "F" followed by this character. By changing Screen.FieldID, multiple screens can be combined into a single HTML Form with field names that won't conflict when it comes time to write the HTML INPUT fields back to a screen. Note that the <TEACTION WEBTOSCREEN> tag will write all fields starting with "F" and followed by this character, so by controlling this value "on the way out" and then controlling it "on the way in", multiple host data entry screens can more easily be converted into a single web page.
Screen.GroupName Read Name of the ScreenSurfer host configuration group that this session is a member of. For example, will return "LU_GROUP_2" if the active session is a member of the second host configured in the Administrator's Console Settings page.
Screen.HostStatus Read Active host connection status for the current session. Useful for determining the active connection status, particularly when the registry setting "KeepSessionValid" is set to YES, which will maintain the validity of a SessionKey even when the host connection has been dropped by the mainframe or AS400. Values include:
ValueDescription
Active Connection to host is active and operational
Stopped No host connection exists
LU_ERROR There is an error on the host connection
LU_PENDING_INIT The host connection is in the process of initializing
LU_PENDING_HOST The host connection is initialized and waiting for completion of host negotiations
LU_LINK_INACTIVE The SNA link to the host is inactive (SNA only)
LU_LINK_ACTIVATING The SNA link is in the process of activating (SNA only)
LU_PU_INACTIVE The Physical Unit for this LU is inactive (SNA only)
LU_REACTIVATED The host connection is in the process of restarting (SNA only)
LU_GETLU The LU requested in the connection is being located (SNA only)
In Progress... The LU connection is being made to SNA server (SNA only)
LU_LUINACTIVE The LU is not set as active in SNA server (SNA only)
Screen.HostWritesExpected Read/Write Current number of host buffer writes expected in the next screen transition. Default is 1.  Changing this value will temporarily change the number of buffers that ScreenSurfer will wait for until sending the next HTML page to the client. This change will last for a single screen transition then revert to the default.

While most host applications "bracket" their output, many situations, such as application logon and/or connection involve multiple host writes. When this occurs, many times there is a fairly significant pause in-between writes, which you may not want to accomodate by having a very high SettleTime. In these circumstances, changing HostWritesExpected will provide far better synchronization.

This value is reset to 1 following a screen transition. So you are able to use it as a temporary override.

See Also: The <TEACTION WAITFOR> and <TEFIND> tags.

Screen.IdleTime Read Number of milliseconds since the last screen interaction (enter). Divided by 1000, provides the number of seconds.
Screen.IgnoreNonWrites  Read/Write  This value has been kept for compatibility reasons, but its use has been replaced by the Screen.DefaultReadyState variable. When set to 1, empty buffer writes from the host are ignored...
Screen.IsEmpty  Read  If the current host screen is an unformatted display with the cursor in position 1 (usually means a blank, unformatted display), this read-only variable will test as the value 1. Otherwise as 0.

Note that if used in a text expression, this will return the text "true" or "false".

Screen.MaxResponseTime Read Provides integer value of highest response time from the host during the current session. ScreenSurfer will update this value each time the current host response time is higher than the previous maximum.

This value is written to the HTTP log in the last entry, along with the most recent ResponseTime, in the last field of the log record.

Screen.PageCount  Read/Write  Current number of pages delivered during the current session. This counter is set to zero when a new session is started, and is incremented automatically by ScreenSurfer each time a <HEAD> tag is sent to the requesting browser.

This may be reset at anytime, as it is a read/write variable.

Screen.Protocol Read/Write  Returns a "3270" if the current connection is to a mainframe using the 3270 protocol, and a 5250 if the current connection is to an AS400 using the 5250 protocol.
Screen.ReadyID Read If the last screen transition was primed with a TEREADYWHEN StrictRecognition tag, on the completion of the screen transition, this variable will contain the name of the recognized screen of those identified in the TEREADYWHEN.

By interogating the value of this variable following the screen transition, you can know which of the potential screens appeared.

Screen.ResponseTime Read Provides integer value of most recent response time from the host during the current session. ScreenSurfer will update this value each time there is a screen transition, either from an EMULATOR request, a TEACTION ENTER or TEACTION GOTO.

Handy for optional display to the user for monitoring the current host responsiveness.

This value is written to the HTTP log in the last entry, along with the MaxResponseTime, in the last field of the log record.

Screen.Rows  Read Returns an integer representing the number of rows on the active screen. Typically 24, but for alternative screen sizes can different (such as 43).
Screen.ScreenID Read  Provides fully qualified text string (template.section) of screen section as recognized in navigation rulebase for the last recognized host screen write. 
Screen.Secure Read/Write Boolean value, returns 1 to an integer expression, "true" to a text expression. This setting is initially set for each session based on the HKEY_LOCAL_MACHINE/Software/iE/ScreenSurfer/Config/SecurityDefault registry setting described in Secure Screens. By changing it, you can turn individual screen security control on or off.
Screen.SecureMachineName Read/Write String value, which represents the IIS machine that handles SSL requests for this session. This value is based on the HKEY_LOCAL_MACHINE/Software/iE/ScreenSurfer/Config/SecureMachineName registry setting. By changing it, you can control which IIS machine an individual session will use for secured ScreenSurfer access.
Screen.SelectClicks Read/Write Boolean value which controls automatic support for selectable (lightpen) fields in a 3270 session. The initial value for a session is based on the HKEY_LOCAL_MACHINE/Software/iE/ScreenSurfer/Config/SelectClicks registry setting. By changing it, you can control the default support for Selectable fields on a per-session basis. When true, all selectable fields as well as the form JavaScript will be generated to support lightpen selection simulation using the mouse, unless overridden using the <TEFORM> tag and the "selectable=no" attribute. When false, selectable fields will not be displayed unless supported with the "selectable=yes" attribute in the <TEFORM> tag.
Screen.SendKeysToAny Read/Write Integer value that defaults to 0. 

Changes behavior of the <TEMACRO SENDKEYS> tag.  When set to 1, disables the validation of current screen, making the "back-button" in the browser work  without needing to code a PATHTO in every TESECTION. 

When set to 1, sent keys don't need to go to the same screen as the one displayed when an HTML page was sent to the browser.  This is relevant to environments that are query-oriented and typically have a single command entry field that accepts commands at any time, such as a document retrieval or library system.

Screen.SessionID Read  Provides text/integer of current sessionID.

Useful for displaying in status area or for generating a session-unique text string, such as a file name or userid for anonymous logons.

Screen.SessionKey Read  Provides text of current sessionkey for embedding in a URL or cookie. Note that this may be used in the same way as TEMACRO SESSIONKEY except that it is appendable or usable in any text expression.
Screen.SettleTime Read/Write Current screen settle time in milliseconds (1000 = 1 Second).  Default is 100.  Changing this value will change the amount of time ScreenSurfer waits for all the data to arrive for a screen. While most host applications "bracket" their output, many situations, such as application logon and/or connection involve multiple host writes. By increasing this value, screen transitions may be "tuned" to accomodate longer pauses between buffers in multiple write situations, preventing partial screens from displaying.
Screen.SilentReconnect Read/Write Boolean value-- controls the "Session Reconnected" message when a user re-connects to an existing session. To suppress display of the message, set to "false" or "no" during your logon SurferScript.
Screen.SilentSynchErr Read/Write Boolean value-- controls the "Screen timer wrong" message when a user re-submits to an out-of-synch screen, or if a host refresh has occurred while the current screen was displayed. To suppress display of the "screen out of synch" message, set to "false" or "no" during your logon SurferScript.
Screen.SynchJava Read/Write Boolean value-- controls the output of the Java applet "SSCheck", which will be included in the HTML generated by the <TEFORM> or <TEMACRO TERMFORM> tag. The SSCheck applet will poll ScreenSurfer following display of the HTML page to determine if an unanticipated host refresh has occurred in the 3270 session. If a host update has occurred, the SSCheck applet will automatically submit a "refresh" request for the current session.

This value is initialized as "true" for each session at start-up when the registry key HKEY_LOCAL_MACHINE/Software/iE/ScreenSurfer/Config/SynchType is set to "1".

SSCheck increases the Poll period by doubling it each time following a poll. The maximum poll value is 8 seconds, and the initial poll value is 500 milliseconds, controlled by the HKEY_LOCAL_MACHINE/Software/iE/ScreenSurfer/Config/StartPoll value. This gives you a total time from the page is first displayed to the time SSCheck stops polling of around 16 seconds.

Screen.SynchScript Read/Write Boolean value-- controls the output of

This value is initialized as "true" for each session at start-up when the registry key HKEY_LOCAL_MACHINE/Software/iE/ScreenSurfer/Config/SynchType is set to "2".

The URL that is called by the included HTML is /surfer/ss_check, which will wait up to screen.synchwait milliseconds before returning (or as soon as a "late update" buffer is sent by the host). You can set a default value for each session's SynchWait time in the registry entry HKEY_LOCAL_MACHINE/Software/iE/ScreenSurfer/Config/SynchWait. This is defaulted to 5000 (5 seconds).

Screen.SynchWait Read/Write Integer - Controls the number of milliseconds that ScreenSurfer will wait for a "late" host update buffer. This is used in conjunction with the Screen.SynchScript setting described above. The setting here does not delay the display of a host screen to the user, but will affect how long the user sees the browser "still working". Note that while the browser is "still working" and waiting for a possible host update, the user can work with the existing screen in a normal fashion.
Screen.TimeOut Read/Write Current screen transition timeout in milliseconds (1000 = 1 Second).  Default is 20000.  Changing this value will cause ScreenSurfer to wait longer for a screen to be refreshed by the host application following a TEACTION ENTER or a user action (clicking on the ENTER button with the mouse for example).
Screen.UpdateTicks Read/Write  Provides integer value of the system clocktick value for the last time a host write to the screen occured. By saving this value and restoring it, you can avoid synchronization issues when performing activities against a screen in a transaction while the user is still active in an HTML form for the "current" screen.
Screen.UserErrors Read/Write  A BOOLEAN value that controls how <TEACTION ..> and SQL errors are handled in SurferScript. Defaults to false-- if you set this to "true", TEACTION and SQL errors will not stop the execution of the current SurferScript. You can then interrogate the session/screen status and/or SqlCode and SqlState values from the <TEDBEXEC> or <TEFETCH> tag that just executed. If there is an error, remember to set task.errorcomponent to a null string (""), or a user error will be triggered when the current section is completed.
Note, that as with all variables (of all types), you can use these special variables in any expression, whether it be a text or numeric, and based on the context the correct value will be used....that's because all variables in ScreenDoor are actually objects, with specific methods for reading and writing values which support each of the four primary types of integer, number (floating point), text and long text.
Top of Page