System-defined variables

Previous Next

System-defined variables

In a USoft client/server GUI, you can refer at all times to values of the following system-defined variables in the USoft Action Language:

System-defined variable

Value

Meaning

applicationStatus

unchanged

No uncommitted data manipulations (INSERT, UPDATE, DELETE) have occurred since the most recent commit or rollback, or since the session started.

changed

One or more uncommitted data manipulations (INSERT, UPDATE, DELETE) have occurred since the most recent commit or rollback, or since the session started.

recordStatus

changed

The current record has been queried and there HAVE been field value manipulations (UPDATE) in the record since it was queried or since it was last stored.

created

The current record is a user-created unstored record:
 

a new completely empty line has been created by the user calling the Create Record event; or

such a user-created empty line is in the process of being filled out with field values, but the record has not yet been stored; or

an ordinary empty line (with initial record status: 'new') is in the process of being filled out with field values, but the record has not yet been stored.

new

The current record is an ordinary empty line. This applies when

an info box is first opened as an empty box, and also when

the user scrolls to the standard empty line that USoft generates below the last queried record line in a queried set of records.

query

The application is currently in Query Mode. Any field values in the current record line have the status of query conditions.

unchanged

The current record has been queried and there have NOT been any field value manipulations (UPDATE) in the record since it was queried or since it was last stored.

(null)

(The current context is not a record in an info box.)

As with other variables in path syntax, in USoft Action Language syntax, you can refer to values of system-defined variables by using a colon:

:applicationStatus

:recordStatus

 

Application status is constantly available in a USoft C/S GUI. At each point in time, it has either the value 'unchanged' or the value 'changed'. Record status has the NULL value when the current context is not a record in an info box, for example, when the end user is currently in the SQL Command dialog.

NOTE 1: When you record a procedure in USoft Benchmark, application status and record status are recorded for each step. When the procedure is played back, USoft checks for each step that the current application status and the current record status are the same as when the procedure step was recorded. If there is a difference, the playback raises an error ("Application status lists different" or "Record status lists different").

NOTE 2: Unlike system-defined global variables (below), you cannot retrieve values of applicationStatus and recordStatus by referring to these variables in a SQL SELECT list. The following raises an error:

SELECT     :applicationStatus

 

However, you can test values of the applicationStatus and recordStatus variables in WHERE clauses of Decision SQL.

Example

In this example, the input parameter passed to the :1 placeholder is selected IF the application status is currently 'unchanged':

(Decision SQL:)

SELECT     :1

WHERE      :applicationStatus = 'unchanged'

 

System-defined global variables

After you have set the language for a Binder project, or executed one of the following methods:

FileExists()

CommandWindows()

 

You can use a system-defined global variable to get the result:

System-defined

global variable

Result of

Return Value

global.language

Setting the language property in USoft Binder.

This is a project property.

{ language-name | }

 

global.fileExists

FileExists(filepath)

{ True | False }

global.system_result

CommandWindows

(command)

{   Success

|   Out of memory

|   File not found

|   Path not found

|   }

If a language has been set, the global.language variable contains this setting, otherwise it contains an empty string.

As with other variables in path syntax, refer to the value of the global using a colon:

:"global.fileExists"

 

Global.system_result returns an empty string if the CommandWindows() command has failed for another reason than Out of memory, File not found, or Path not found.