[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 +
 Addition, unary positive, concatenation         (Math, Character)
------------------------------------------------------------------------------
 Syntax

     <nNumber1> + <nNumber2>           (addition)
     <dDate>    + <nNumber>            (addition)
     <cString1> + <cString2>           (concatenation)

 Type

     Character, date, memo, numeric

 Operands

     <nNumber1> is a numeric value to increment by <nNumber2>.

     <dDate> is a date value to increment by <nNumber> days.

     <cString2> is a character string to join to the end of
     <cString1>.

 Description

     The (+) operator performs a number of different operations depending on
     the data types of the operands:

     .  Unary positive sign (numeric): A numeric expression prefaced
        with the plus (+) operator performs no operation on the operand
        except to enforce a higher level of precedence than other numeric
        operations (except the unary minus).

     .  Binary addition sign (numeric, date): If both operands are
        numeric, <nNumber2> is added to <nNumber1> and the result is returned
        as a numeric value.  If either operand is date data type and the
        other operand numeric data type, the <nNumber> is added as days to
        the <dDate> and a date value is returned.

     .  Concatenation (character, memo): If both operands are
        character, <cString2> (the right operand) is concatenated to
        <cString1> (the left operand) returning a character string.

 Examples

     .  These examples illustrate the various forms of the + operator:

        // Binary addition (numeric)
        ? 1 + 1                           // Result: 2
        ? 1 + 0                           // Result: 1
        ? 0 + 1                           // Result: 1

        // Binary addition (date)
        ? CTOD("12/12/88") + 12         // Result: 12/24/88
        ? 12 + CTOD("12/12/88")         // Result: 12/24/88

        // Concatenation (character)
        ? "Hi " + "there"               // Result: Hi there


See Also: % * ** - / = (compound)
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson