EXAMPLES:
N%ER quantity
NUMBER amount_due credtt
NUIE)ER area_code phone_exchange phone_number
The a11owab1e range of values for numeric variables in DataFlex is: + or - 99,999,999,999,999.9999
EXPRESSIONS
Arithmetic expressions are numeric type arguments that are evaluated
as they are acted upon by DataFjex comnands. Expressions ÁQjjQt have
to be evaluated
first
and then placed into a variable. They areautcmatical1y evaluated by the DataFlex comand processor when encountered during the execution of a configuration. The result of
the expression is then processed by the cormand.
Any valid numeric representation may be a component of an expression
including: numeric constant5p numeric varfab1esg numeric ehments in
the data base (addressed as filename.fieldnameb date variables or
data Input from the keyboard by an operator and stored in a data
window.
The following symbols are used to fnstruct the comand processor how
to perform the expression evaluation:
ADDITION
"
SUBTRACTION
-
MULTIPLICATION *
DIVISION
/
RETURN GREATER THAN > RETURN LESS THAN <
PARENTHESES' (
...
)The
first
four operators above are se7f-exp1anatory. However, thelast two expressfon operators require some explanation. Two numeric arguments are supplied to these operators* and depending upon the symbol selected, the greater or lesser of the arguments
will
bereturned. For example: In 3>59 5 will be returned; in 3<5, 3 will be
returned. No modification is made to the data. These evaluations only make selections,
Expressions are formatted by enclosing the numeric arguments which make up the expressiom with operatorm in parentheses. The DataFlex
DataF1ex 2.0 User's Manual ELEMENTS OF CONFIGURATIONS C-5
—————— ————————————— — —
command processor recognizes the parentheses and evaluates the
expressiom making the result available for command processing just as
if
a constant had been used in place of the expression. EXAMPLES:(argl + arg2) (balance + sale)
(argl
-
arg2) (balance-
payment)(argl * arg2) (quantity " value) (argl / arg2) (principal / months)
Multiple levels of parentheses are supported to control the sequence
of the arithmetic evaluation of the expression. In an expression that contains multiple parenthesesg the portion of the expression contained
in the innermost pair of parentheses
will
be evaluatedfirst.
EXAMPLE:(un1t_cost)*(reorder_qty - qty_on_hand))
In this example, UNIT_C0ST would be multiplied by the
difference between RE0RDER_QTY and QTY_0N_HAND because the
difference is enclosed in parentheses. WIthout the
parentheses, UNIT_C0ST would
first
be multiplied byRE0RDER_QTY, and QTY_CN_HAND subtracted from the product, a mean'ingless result.
Without parentheses In an expression, evaluation Is
left
to rfght. DATE VARIABLESNOTE: DataF1ex supports two date formats in different versions of the
product. The two supported formats are MM/DD/YY and DD/MM/YY. We refer to the latter as the "Euro-date" format. For the. purposes of this documentation we
will
refer to formatted dates as MM/DD/YY, even though Euro-date versions of DataFlex accept and return dates in the format of DD/MM/YY.Dates are stored in DataFlex in Julian form as numbers. The displayed and printed date format MM/DD/YY which appears in screens and reports
is a de-coded representation of the numeric storage format. A date
variable can be defined to manipulate date information within a
configuration by using the DATE definition command. Multiple date
variables can be defined on a single argument definition line. The data stored in the date variable is a Julian numeric value.
Therefore, any operation requiring calculations on dates can be executed directly by reference to the variable without the necessity for type conversion. When dates are output to screens and reportm
internal DataF1ex routines which are flagged by the data type of the
variable decode
it
automatically into the MM/DD/YY format...——
C-6 ELEMENTS OF CONFIGURATIONS DataFlex 2.0 User's Manual FORMAT: DATE date_variab1el .. . date_variable9 EXAMPLES : DATE due
DATE today tomorrow yesterday invo1ce_due
DATE CONSTANTS
Date constants (expressed as MM/DD/YY) can be used as the subject of DataF1ex comands, but they cannot be used within expressions. They can be placed in date variables using the DataF1ex "MOVE" comand for use in date variab7es.
EXAMPL ES : LEGAL
--
DATEMOVE BIRTHDAY01/16146 TO BIRTHDAY LEGAL--
DATEMOVE BIRTHDAY01/16/46 TO BIRTHDAYCALCULATE (BIRTHDAY + 365) TO NEXTJ3IRTHDAY TI I FGM
--
CAL(JJLATE (01/01/83 + IQ) TO INVOICE.DUELEGAL — DATE DATE_S0LD
MOVE 01/01183 TO DATE-SOLD
cALájLATE (DATE-SOLD + IQ) TO INVOICE.DUE
FILENAMES
The "df_ filenames" of DataF1ex data base
files
can be used as connand arguments. Valid "df_ filenames" that can be used as arguments must beestablished with the DataFlex FILEDEF
utility
(see the section of this manual on File Definition for a discussion of the df_ filenameconventions) . FORMAT:
OPEN df_ filename
"df_ filename" in the format example is an argument for the OPEN coman d
.
———————
DataF1ex 2.0 User's Manual ELEMENTS OF CONFIGURATIONS C-7
EXAMPLE:
OPEN Inventory CLOSE customer
The symbolic names of individual elements in a database can be used as arguments for a variety of DataFlex commands. A spécif'ko formatted
syntax is provided to represent these arguments. which are composed of
the filename and fieldname of the data base element: FORMAT: FILENAME.FIELDNAME EXAMPLES: fnventory.description custcimer.current_ba1ance custcmer.credlt_11m1t INDICATORS
An indicator is established by issuing an INDICATOR comand with the
indicator name as the argument of the comnand.
It
takes on thecharacteristics of a "flag" which is tested by the configuration to determine whether a connand line or group is to be executed. The INDICATOR comand only establishes an indicator;
it
does not "set"it
to a status.
FORMAT:
INDICATOR 1ndfcator_argl