Common Variables provide an alternative method of accessing and storing values in the PROIV’s Common Block. They offer an alternative to the @$COM1..10 and @#COM1…10 system variables and are system-wide variables that facilitate transfer of data from one function to another. Once defined, values can be written to or retrieved from the Common Block through use of four Global Logics: @PUTVAL, @GETVAL, @PUTNVAL, and @GETNVAL. The developer creates a new variable in a Screen function and uses @PUTVAL and @GETVAL logics to pass values between non-Global Logics, or those that are not linked together with Interface Maps.

The method of using Global Logics to populate and retrieve data allows for the definition of Common Variables that are standardised across an application rather than using Common Block (@$COM and @#COM) variables or workfiles.

The advantages of adopting this method of populating and retrieving values from named variables are:

  • Provides an overview of the data that is being passed by Common Variables across the application.

  • Enables the access of Common Variables by a logical name rather than a variable and position, which reduces the risk of error.

  • Enables the expansion and amendment of Common Variables with no impact on the calling functions.

The four Global Logics work in pairs:

  • @PUTVAL and @GETVAL are used to populate and retrieve alphanumeric data

  • @PUTNVAL and @GETNVAL are used to populate and retrieve numeric data.

Syntax

The syntax for the use of @PUTVAL and @GETVAL is shown below. (The syntax for @PUTNVAL and @GETNVAL is the same, and therefore not included in this document.)

@PUTVAL

Syntax:

@PUTVAL('COMMON-NAME',$VALUE)

COMMON-NAME is a literal or variable used to denote the name of the value that is to be passed into the Common Block.

$VALUE is a literal or variable that contains the value that is to be placed into the Common Block.

@GETVAL

Syntax:

$VARIABLE = @GETVAL('COMMON-NAME')

COMMON-NAME is a literal or variable used to denote the name of the value that is to be extracted out of the Common Block.

$VARIABLE is a variable that the extracted value from Common Block is assigned to.

The definition of the Common Block is designed by an application programmer. There is no rule as to what elements make up the Common Block. Generally, they are key elements of the project and be required by more than one function. Two general purpose common elements, GENRL1 and GENRL2 are provided to allow for the passing of less important or function specific data.

Two additional Common Variables are also defined within the alphanumeric Global Logics; @PUTVAL and @GETVAL, these are TERM and TODAY. These contain the Terminal ID and today’s internal PROIV data. The use of these values from the Common Block has several advantages, especially TODAY. This allows the internal date that is being used by the user in the application to be changed without affecting other users and applications. The internal date therefore, becomes soft coded.

Passing the CLEAR parameter to the @PUTVAL routine clears all Common Variables that have had their Variable Clear Indicator set (both alpha and numeric). Passing the CLEARALL parameter operates in a similar way except that all Common Variables are cleared regardless of the setting of their indicator.

For example:

@PUTVAL(“CLEAR“,““)

Clears all the variables with the Variable Clear Indicator set.

For example:

@PUTVAL(“CLEARALL“,““)

Nulls all variables regardless of the Variable Clear Indicator setting

PROIV Aurora and Common Variables

The Common Variable Maintenance screen in PROIV Aurora enables you to view the values by Terminal ID, and add, delete and amend the Common Variables. However, you cannot set values on this screen.

Comment on this topic

Topic ID: 810092

Table of Contents

Index

Glossary

-Search-

Back