Identical Variables - Not Recommended

GPP supports the notion of identical variables. It is possible to declare two or more variable to be identical, which has the following results:

  • They will always have the same value. Whenever the value of one variable changes, all other identical variables get the same value.

  • They share the same set status flag value. Each time a variable is turned on or off (for whatever reason), all other identical variables are also turned on or off.

Identical variables do not have to share the same format. They can use different formats, as long as they are of the same type (numeric or string). It is not possible to declare variables of different types as identical - a compilation error will result.

Identical variables of different formats always share the same internal value. When used in OUTOUT statements, the printed results may be different depending on the formats, but the internal values are always the same.

Declaring two or more system variables as identical is not recommended, since GPP may try to assign different values to these system variables. The result is unpredictable (the variables will end up having the same value, but it is not possible to know which value prevailed). A compilation warning will be issued if two or more system variables are declared as identical.

Arrays and array members cannot be declared identical to any other variable.

Some functionality may be dependent on the product package. Contact your Reseller if you require a license.