# DECLARE

Syntax:

DECLARE LOCAL | The variable is visible only to the current prc table.
DECLARE GLOBAL | Makes the variable visible to other prc tables.
DECLARE EXTERN | Refers to a variable DECLARED GLOBAL in another table.
DECLARE | Same as DECLARE LOCAL.

Version Ref: 4.8 (not included in filePro Lite)

Description:

Declare global and local dummy variables with LONG names of up to 64 characters. Only applies to Define Processing. DECLARE variables are not supported on Screens or Output Formats. A declared variable can hold up to 32127 characters.

Caution: Avoid the use of reserved words such as "select", "max", etc. as variable names since these are functions and will not be properly interpreted as variable names. Although the processing will pass the syntax check, it will produce unwanted results.

Note: The meaning of GLOBAL when used with DECLARE is different than the meaning of the global ",g" flag used when specifying a field's type and length. The global ",g" tells filePro that the value of the field spans record to record. DECLARE GLOBAL tells filePro the field spans processing tables.

DECLARE variables can be used anywhere in processing that the classic 2-letter dummy fields could be used. If one table has DECLARE GLOBAL, and another table has the same name using DECLARE LOCAL, each table uses its own copy of that name.

Example:

Then: DECLARE GLOBAL LastName(20,*,g), FirstName(20,*,g)

Then: DECLARE LOCAL YTDSales(10,.2)