System Variables

System Variables are predefined and are provided to standardise development of applications. System variables may be referenced in any function.

System Variable

Character Type and Length

Description

$INPUT

A250

Contains alphanumeric or embedded wide data from keyboard entry in the current field. This variable should be accessed or changed only from General Check or Special Check logic.

!INPUT

W125; the maximum is 125 wide characters

Contains wide character data from keyboard entry in the current field  This variable should be accessed or changed only from General Check or Special Check logic

#INPUT

N12/15/20

Dependent upon the maximum length of the variable being input. Numeric equivalent to $INPUT for numeric field entry.

@CFLD

N3

Contains the field number where the cursor was previously located.

@CLIENTINFO

A80

Returns the handle of PROIV Client main window.

@COMP

A3

Current company/division code.

@COUNT

N12/15

Contains the number of records from the primary file that have been selected for processing in a Report Cycle and Update Cycle.

@CPSEQ

N3

Contains the Paging Record Sequence Number where the cursor was previously located.

@CRTLEN

N (The number format is determined by PROIV Developer)

The length of the screen, in rows.

@CUREVENTTAG

A32

Returns the Tag Name of the last ActiveX control referenced in the current session.

@CURFLDNAME

A32

Returns the Tag Name of the field where the cursor is currently positioned.

@CURFUNCT

A32

The function name currently executing. This is different from @FUNCT, which gives the top-level function name executing.

@CURLSNAME

A32

Returns the Tag Name of the currently executed cycle.

@CUR_FL

N (The number format is determined by PROIV Developer)

The file number in a cycle being accessed.

@CUR_LS

N (The number format is determined by PROIV Developer)

DEPRECATED. The cycle number currently executing. Deprecated in favour of @CURLSNAME which gives the Tag, not the number.

@DATE

N6

Contains the system date, stored as the number of days since December 31, 1799. When you use @DATE as a Report or Screen field, or in a Report heading, specify the display code DATE or DATE4 to output the date in user-readable format, for example 05/09/10.

@DFUNCT

A32

The name of a function to execute instead of displaying the system command prompt (?). This can be made user-specific by entering a function name on the Operator Security Profile window.

A value specified via @DFUNCT overrides an entry made at the Operator Security Profile window. If the function currently being executed is specified as the @DFUNCT function, pressing the interrupt key results in a possible loop situation (the @DFUNCT function being called again) and so PROIV exits.

@DTFMT

N1

Sets the date format:

0 = MM/DD/YY

1 = DD/MM/YY

2 = YY-MM-DD

@EODEXIT

A1

Returns ‘Y’ after an EODEXIT(1) or EODEXIT(VALIDATE). Otherwise it returns ‘’.

@EVENTNAME

A32

Returns the name of the last ActiveX event fired in the current session.

@TIME

A6

System time stored in the form HHMMSS using the 24-hour clock.

@TERM

A8

The current terminal ID.

@EFUNCT

A32

The name of the next function to be executed upon alternate or error exit from the current function.

On entry to a function this is set or reset to the value specified in the Error field on the Events tab on the Function Definition window. @EFUNCT may be interrogated or modified in any logic routine. Changing the value of @EFUNCT in logic overrides that specified in Error field.

@ERR

A8

Number of the system error that has occurred. You should not change this value.

@ERRARGS

A240

Contains the arguments used in the message of the last system error that occurred. You should not change this value.

@ERRTEXT

A80

Contains the text used in the message of the last system error that occurred. You should not change this value

@FLD

N3

The number of the field currently being processed. Applies only to Screen and Report functions. @FLD should not be confused with the FLD logic statement.

@FNKEY

N2

The number that corresponds to the Function Key most recently pressed. This can be interrogated in logic. For a complete list of Function Keys and their numbers, see Function Key Values.

@FUNCT

A32

Contains the name of the function currently executing. For example, the top-level function that is executing but not Global function calls.

@LFUNCT

A8

The name of the next function to be executed upon normal exit from the function. On entry to a function this is set or reset to the value specified in Exit field on the Events tab on the Function Definition window.  @LFUNCT may be interrogated or modified in any logic routine.  Changing the value of @LFUNCT in logic overrides that specified in Exit field.

@LINE

N3

The current line number on the current page of the report being output. Applies only to Report functions.

@LS_TITLE

A250

When a cycle is entered, this variable is checked. If it has a value in it, that value is used for the title.  If there is no value, the title comes from the usual place.  In order to have an effect, @LS_TITLE must be assigned before the cycle is entered. @LS_TITLE is cleared by the kernel when used.

@MENUNAME

A8

The name of the last menu executed.

@MODE

A1

The currently active Screen mode (A, C, D, or L). This variable is useful when actions in a Screen function are determined by the Screen mode, and @MODE can be interrogated. You should not change this value.

For example, when a detail line is added, an invoice line amount is added to the invoice total, but when a detail line is deleted, the amount is subtracted from the total.

There is a known restriction in that @MODE does not report correctly when used in Augmented Display Mode.

@MODE_EXTENDED

A2

Returns the mode of the active screen (A, AI, C, D, or L). This variable uses positional testing (i.e., the two arguments are x,y coordinates for the screen).  

For example, if the system cursor is located in the 1,1 position of the screen, and the code IF @MODE_EXTENDED(1,1)=’I’, is true, then the active screen is in Insert mode.  

If the code IF @MODE_EXTENDED(1,1)='A', is true, then the mode is either Add mode or Insert Mode.  

Another variation would be to not use parameters.  For example, @MODE_EXTENDED by itself would return ‘AI’ if Insert mode is on, ‘A’ if the mode is Add, ‘C’ for Change mode, ‘D’ for Delete mode, and ‘L’ for Look mode.

There is a known restriction in that @MODE_EXTENDED does not report correctly when used in Augmented Display Mode.

@MSG

N4

PROIV message number.

@MSGTEXT

A80

Text description for @MSG.

@MSGARGS

A80

Parameters for @MSG.

@OPR

A3

Current operator ID, i.e. the ID of the operator currently using the terminal.

@PAGE#

N4

The current page number during report execution. PROIV automatically numbers report pages by default starting with page 1. When a series of Report functions create one report, it may be desirable for each new function to increment the last used page number by one. This can be accomplished by passing the page number from the one Report function to the next, via a Communication Variable, and initialising @PAGE# in the default logic.

@PFKEY

A6

The Function Key previously pressed.

@PFUNCT

A32

The name of the previously executed function. This variable is useful when actions in the current function are based upon knowing what the prior function was (for example, interpretation of Communication Variables).

@PRODEF

A40

The path of the directory containing the alternate language bootstrap files. This system variable cannot be set by user logic assignment.  This is a ‘demand’ type of System Variable and can only be set through an initialisation file entry, PRODEF. Where alternate language bootstraps do not exist, this variable is blank. The default PROIV system is maintained in the directory where the system variable @PRODEF points. While executing a function, the kernel first searches for it in the FUNCTDEF of @PRODEF.  If it finds it there, the function is executed using the FUNCTDEF, MSGF, GENFILE of the @PRODEF.  If the function must be genned, it should be genned using the development specifications of the language where FUNCTDEF is found.

The process of loading Value Variables when a function starts, is to first look for VARDEF in @PRODEF. If it is not found, the PROPATH is searched for VARDEF. If the function is not found in @PRODEF, it looks for the function in the PROPATH FUNCTDEF. If it is not found, then an invalid function name message displays. The same search path is used for Global functions.

PROIV Bootstraps are normally maintained unless the user has a language specific one in the directory PROPATH. This is known as the MAIN object base.

@PSEQ

N5

A system-generated sequence number between 1 and 32,767, that is used to implement indexed Paging Screens. You should not change this value. Indexed Paging Screens are most commonly used to process non-auto-sequenced files.  Records are maintained in key sequence order.

Indexed paging is signified by a SEL ONLY, SEL-PARTIAL, or SEL RANGE logic statement in the default logic for the cycle (logic performed on entry to the cycle).  This specifies the selection criteria for records to be retrieved for processing; the full set of records can be selected by using a null selection criteria. PROIV automatically maintains a sequence number in the system variable @PSEQ, and you can display or make use of this if required. Indexed Paging Screens can be used on auto-sequenced files, but auto-sequencing of keys is not performed.

@RETCD

N8

Contains the function's Return code.

@RFUNCT

A32

The name of a function to execute in the event of a transaction processing rollback error. The default is function @RFUNCT.

@RPTOPT

A90/A134

It is possible to modify spooler parameters dynamically at execution time using the @RPTOPT System Variable. This allows you to override the fields specified set in the Report Function Definition Spooler window.  The variable can be in either fixed field or freeform format.

Fixed field format is a character string with a length of 90. $SPOOL options have assigned substring positions within @RPTOPT additional options. Commas must not be used in this format (this is because commas indicate freeform format).

Freeform format can be up to 134 bytes long. Within that total length, each field can be any length and is delimited by a comma. If there is no value for a given field, the field is delimited by a comma except that trailing empty fields can be omitted entirely. The position of each field in the freeform format is the same as its position in the fixed form.

For example, the following string has an empty position, a device name, four empty positions, and a Y to specify that detail lines are to be suppressed. Because the remaining fields are not present, they are considered empty

(,PRT_DEVICE5, , , , ,Y)

Overrides to report or update options via @RPTOPT are not permanent. They only affect the next Report or Update function as it is executed from a specific terminal or task. PROIV nulls @RPTOPT after using the override information, prior to executing the function. PROIV activates @RPTOPT at the start of function execution. If the contents of @RPTOPT are changed while a specific function is executing, those changes will affect the next Report function to be executed.

@RETRYCOUNT

N5

A number between 0 and 32,767, which is the number of times a record has been read trying to obtain a lock. You should not change this value.

@SELECT

N2

The selection number the user entered at the last menu.

 

@SPSEQ

N5

Contains the sequence number of the record that is to be the first record displayed in the Paging Screen.  This is normally assigned a value in logic before commencing the Paging Screen.

@SQL_TIMEOUT

N10

The @SQL_TIMEOUT (system variable) and LOCKED_ROWS_RETURNED and SQLSERVE_TABLE_LOCKING (PROIV Environment Variables) must be enabled for SQL Server to use the enhanced record lock mechanism.

The settings for SQL_TIMEOUT are as follows:

@SQL_TIMEOUT      -1      - Report record lock immediately by the SQL command is issued to the database

@SQL_TIMEOUT       0      - Block indefinitely until the database releases the record lock

@SQL_TIMEOUT     >0      - Block for the specified amount of seconds before raising a record lock message

@SQL_TIMEOUT defined in PROIV Logic has higher precedence over SQLTIMEOUT. Click here for more information about SQLTIMEOUT Environment Variable.

To ensure the break key works LOCKED_ROWS_RETURNED=Y and SQLSERVE_TABLE_LOCKING =Y must be defined.  If SQLSERVE_TABLE_LOCKING is not specified, it is enabled by default from PROIV v6.1.57.0 release onwards.

@SYSERR

A6

The last status code returned by the operating system that indicated an error occurred. The status code is represented in hexadecimal. Logical errors that are not reflected in an operating system status code do not change this value. This value is cleared on entry to each function.  This value  indicates the last error that occurred in the currently executing function.

@SYSERRDESC

A60

Contains a description of the system error.

@SYSID

A20

The ID of the system where PROIV is running. You should not change this value.

@SYSPASS

A1

The variable returns 'Y' if the System Display Pass is being performed, otherwise it is blank. The System Display Pass is the pass of the field displays that occurs after the Last Read field is entered, and before the cursor is positioned for input at the next input field.

During field input, the variable is set after the Last Read field is entered, and is unset after the System Display Pass (that occurs after the Last Read field has been entered) is completed.

In Paging Screens, the variable is set and unset before and after each Paging Record appears. Typically, this feature is used to restrict logic processing from being executed twice on a single record, once during the System Display Pass and once during field input. For example, a file variable, CURRAMT, is added to a scratch total field #TOTAL for each record in the After Field logic for the CURRAMT field.  Assuming that the CURRAMT field's number is higher than the Last Read field, once the Last Read field is entered, all the files are read and the System Display Pass occurs.  

During the System Display Pass, the CURRAMT field is processed, and the value read from the file appears on the screen. When the After Field logic is processed, #TOTAL is incremented by CURRAMT.  Once the System Display Pass is complete, the cursor is positioned for input at the first field after the Last Read field.  When the CURRAMT field is processed, the data input for the field (or the previous value of the field if no data was input) is then added to #TOTAL again in the After Field logic, at this point, the value of #TOTAL is actually #TOTAL+2(CURRAMT). To avoid this situation, the After Field logic for CURRAMT should look something like the following:

001 IF @SYSPASS= "Y" THEN

002  EXIT

003 ELSE

004  #TOTAL=#TOTAL+CURRAMT

005 ENDIF

This causes #TOTAL to be added to only after input to the CURRAMT field

@TASKID

A8

Contains the task number of the last job when PROIV submits a function to a server.

@TERM

A8

Contains the current terminal ID.

@TFUNCT

A32

The name of a function to execute if the keyboard inactivity timeout period is exceeded. This can be made user-specific by entering a function name in the Timeout field on the Operator Security Profile window, although a value entered in @TFUNCT overrides that value.

@TIME

A6

Contains the system time, stored in the form HHMMSS using the 24-hour clock. When using @TIME as a Report or Screen field, or in a Report heading, specify the display code TIME to output the time as HH:MM:SS. This value should not be changed.

@TIMEOUT

N3

Specifies the keyboard inactivity timeout period in minutes. (0 = no timeout)

If there is no keyboard input during the time period, the function specified in the @TFUNCT is executed. This can be made user-specific by entering a value in the Timeout Limit field on the Operator Security Profile window, although a value entered in @TIMEOUT overrides that value.

@VMODES

A4

Values are A(dd), D(elete), C(hange), L(ook Up). See Mode Processing for more information on Modes. This setting is not automatically reset. If the developer sets it, it will remain set to that value until they change it.

There is a known restriction in that @VMODES does not have any affect in Augmented Lookup.

@XFUNCT

A32

The function that is executed when the is clicked to exit the PROIV Client.

@XMODE

A1

Valid values are A(dd), C(hange), D(elete), L(ookup). If a value is specified for @XMODE, the next cycle executed will use the @XMODE specification, overriding any predetermined value. Applies to Screen functions only.

Communication Variables

Communication Variables (also called COM variables) are System Variables that facilitate transfer of data from one function to another. Values can be set in Function Logic and are retained until logoff or when expressly changed. There are 10 alphanumeric, 10 wide, and 10 numeric COM variables. Each logged on user has their own set of variables.

To use Communication Variables, specify the details of the COM variable in a function, and then retrieve the value in subsequent functions.

System Variable

Character Type and Length

Description

Alpha Communications Variables

 

 

@$COM1 - @$COM10

A32/80

Ten alphanumeric communication or common variables used to pass data from one function to another. @$COM1 to @$COM9 are 32-character alphanumeric variables, while @$COM10 is an 80-character alphanumeric variable. These values may be passed between functions that include embedded wide characters.

Numeric Communications Variables

 

 

@#COM1 - @#COM10

N17

Ten numeric Communication Variables used to pass numeric data from one function to another. The default display code is 9.6-.

Wide Communication Variables

 

 

@!COM1 - @!COM10

W15/40

Ten wide communication or common variables used to pass data from one function to another. @!COM1 through @!COM9 contain 15 wide characters, while @!COM10 contains 40 wide characters

 

Comment on this topic

Topic ID: 730016