— Decrement

 Decrement--unary                                (Mathematical)

     --<idVar>       (prefix decrement)
     <idVar>--       (postfix decrement)


     Date, numeric


     <idVar> is any valid CA-Clipper identifier, including a field
     variable.  If <idVar> is a field, you must reference it prefaced with an
     alias or declare it with the FIELD statement.

     In addition, you must initialize <idVar> to a value before performing
     the decrement operation, and it must be either numeric or date data


     The decrement operator (--) decreases the value of its operand by one.
     This operator subtracts one from the value of <idVar> and assigns the
     new value to <idVar>.

     The -- operator can appear before or after <idVar>.  Specifying the
     operator before <idVar> decrements and assigns the value before the
     value is used.  This is called prefix notation, and it is the most
     common usage.  Specifying the operator after <idVar> decrements and
     assigns the value after it is used.  This is postfix notation.  Stated
     differently, postfix notation delays the assignment portion of the
     operation until the rest of the expression is evaluated, and prefix
     notation gives the assignment precedence over all other operations in
     the expression.

     If the reference to <idVar> is ambiguous (i.e., not declared at compile
     time and not explicitly qualified with an alias), <idVar> is always
     assumed to be MEMVAR.  You can assign field variables by declaring the
     field variable name in a FIELD statement or by referring to the field
     name prefaced by the FIELD-> alias or by the name of the work area.


     .  In this example of the postfix decrement operator the
        assignment takes place before the original variable is decremented,
        thus the two values are not the same when queried:

        nValue := 1
        nNewValue := nValue--
        ? nNewValue                  // Result:   1
        ? nValue                     // Result:   0

     .  In this example, the prefix decrement operator decreases the
        first operand of the multiplication by one, making its value 9.
        Then, the assignment of this new value to the nValue variable takes
        place before the rest of the expression is evaluated.  Thus, the new
        value is used to perform the multiplication operation, and the result
        of 9 * 9 is 81.

        nValue := 10
        ? --nValue * nValue          // Result:  81
        ? nValue                     // Result:   9

See Also: ++ – := = (compound)

Expression Terms

Assignment :

The act of copying a new value into a variable. In Clipper language this is done with the simple assignment operators (=) and (:=), or the compound operators (+=, -=, *=, **=).

Binary Operator :

An operator that operates on two operands. For example, the addition operator.

See Also: Operator

Character Functions :

Those functions that act upon individual characters or strings of ASCII characters in the performance of their tasks.

See Also: ASCII, Function, String

Concatenate :

To combine two groups of character data together by placing them in a sequence to form a new string of characters.

See Also: Data Type

Condition :

A logical expression that determines whether an operation will take place. With database commands, a logical expression that determines what records are included in an operation. Conditions are specified as arguments of the FOR or WHILE clause.

Conversion Functions :

Generally referring to a category of functions whose purpose is to change one data type to another (e.g., to change a number or a date to a character string).

Date Functions :

Functions that operate on date values (as opposed to character, numeric or other values).

See Also: Function

Decrement :

To decrease a value by a fixed amount, usually one. In Clipper, the decrement operator (–) can be used to decrement a numeric value in a variable.

See Also: Assignment Increment

Destination :

The variable or array element to receive data in an assignment.

See Also: Assignment

Evaluate :

To execute part of a program in order to produce a value. For an expression, to execute the program code associated with the expression and return the resulting value. For the macro operator, to compile the macro string, execute the resulting program code, and return the resulting value.

See also : Expression

Expression :

A combination of constants, identifiers, operators, and functions that yield a single value when evaluated.

Increment :

To increase a value by a fixed amount, usually one. In Clipper language the increment operator (++) can be used to increment a numeric value in a variable.

List :

A list of expressions, field names, or filenames, separated by commas specified generally as command, procedure, or function arguments. Code blocks can also execute a list of expressions.

Macro :

In Clipper language, an operation that allows source code to be compiled and executed at runtime. In Clipper language, the macro symbol (&) does not perform text substitution unless embedded within a character string. Instead, it is generally treated as a unary operator that operates on a character string. The text in the character string is compiled on the fly using a special runtime compiler. The resulting code is then executed, and the value obtained is returned as the result of the macro operation.

See Also: Code Block, Unary Operator

Operand :

A value that is operated on by an operator, or the term in an expression that specifies such a value. For example, in the expression x + 5, x and 5 are operands.

See Also: Operator

Operator :

A symbol that identifies a basic operation. For example, the multiplication operator (*) denotes that two values are to be multiplied. Operators are categorized as either unary or binary, depending on whether they require one or two operands, respectively.

See Also: Binary Operator, Operand, Unary Operator

Precedence :

The stature of an operator in the hierarchy that determines the order in which expressions are evaluated. For example, the expression 5 + 2 * 3 is interpreted as 5 + (2 * 3) because the multiply operator (*) has a higher precedence than the addition operator (+).

See Also: Expression

Recursion :

The calling of a procedure by a statement in that same procedure. When a procedure calls itself it is said to recurse. A recursive call causes a new activation of the procedure. If the source code for the procedure includes a declaration of local variables, a new set of local variables is created for each activation. A private variable created by the procedure is associated with the activation in which it is created, and is visible in that activation and any lower-level activations, unless obscured by a private variable created in a lower-level activation.

See Also: Activation, Function, Private Variable, Procedure

Shortcutting :

A compiler optimization that causes expressions to be evaluated only to the extent required to determine their outcome. For example, in the expression f() .OR. g() function g need not be executed if function f returns true (.T.). Clipper language performs shortcutting on all logical operators (.OR. .AND. .NOT.).

Truncate :

To remove insignificant information from the end of an item of data. With numerics, to ignore any part of the number that falls outside of the specified precision.

Unary Operator :

An operator that operates on a single operand. For example, the .NOT. operator.

See Also: Binary Operator, Operator