Skip to content

#SET Compiler Directive

Purpose

Assigns a value to an Integer compile-time variable.

Syntax

#Set {variable-identifier}$ {expression}

Argument Explanation

  • variable-identifier: This is the identifier of the compile-time variable. The variable-identifier can be one of A…Z or ZA…ZZ and must be followed by a $ symbol.

  • expression: This is an expression that is evaluated at compile-time and assigned to the compile-time variable.

What It Does

Macros and program files can use and evaluate integer numbers and expressions at compile time, which are generally used for assigning sequential numbers to labels or compile-time variables. There are 52 such integer variables (named A...Z and ZA…ZZ).

The case of the compile-time variable has special meaning. If an upper case letter is used, the value of the variable is incremented before use; if a lower case letter is used, the value will remain unchanged. The compile-time variables are referenced with an exclamation point (!) preceding its letter. The value of the variable in text form is substituted for the !x in the line output.

The value of any Integer compile-time variable can be set with the #Set command.

The expression can be any Integer expression that can be evaluated at compile time, and it can itself contain Integer compile-time variables. Expressions should be embedded in parentheses.

The following example means #Set Integer Variable F to the value of Integer Variable r minus one. Since r is lower case, it will not be automatically incremented.

#Set F$ (!r - 1)

Many of the compile-time variables are reserved for use by the DataFlex language. The following tables list each variable and a description of its use in the DataFlex macro language:

Compile-Time Variables

Variable Usage
!A Next line number
!B reserved
!C Next indicator number
!D Next integer number
!E Autopage window number
!F Autopage page number
!G ~ !M unused and available
!N Static nesting level
!O reserved
!P reserved
!Q Low level temporary
!R Static structure number (begin ... end)
!S Temporary, used by end, loop, until
!T reserved
!U reserved
!V Next variable number
!W reserved
!X Temporary, enter and report file numbers
!Y Temporary, keyproc
!Z reserved

Object Command Variables

The compile-time variables used by the object commands are all two-character names beginning with Z:

Variable Name Usage
ZA$ procedure/function Label for procedures and functions
ZB$ current_dep The current dependent number to assign
ZC$ current_message The current flex message number
ZD$ group_size Size of the current item group
ZE$ group_id Unique ID of current item group
ZF$ super_class_count Count of objects in superclass
ZG$ temp Temp counter (items, functions etc.)
ZH$ access_method The current access method identifier
ZI$ sub_obj_count The sub object counter
ZJ$ current_object The current_object number
ZS$ enum_flag True when compiling in an enumeration list
ZT$ enum_value Current value being assigned in enumeration list