Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide To Clipper - <b>- subtract, unary negative, concatenate (math, character)</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
-              Subtract, unary negative, concatenate      (Math, Character)


Syntax:        <expN1> - <expN1>
               <expD>  - <expN3>
               <expC1> - <expC2>

Type:          Numeric, date, character, memo

Operands:      <expN1> is a numeric value to decrement by
               <expN2>.

               <expD> is a date value to decrement by <expN3>
               days.

               <expC2> is a character string to concatenate to the
               end of <expC1> after trimming the blanks from
               <expC1>.

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

               Unary negative sign (numeric): A numeric expression
               prefaced with the plus (-) operator performs the
               equivalent of multiplying the operand by (-1) returning a
               negative numeric value.

               Binary subtraction (numeric, date): If both operands
               are numeric, <expN2> is subtracted from <expN1> and the
               result is returned as a numeric value.  If the left
               operand is date and the right operand numeric, the <expN>
               is subtracted as days from <expD> and a date value is
               returned.  If the order of operands is reversed, an
               Expression error occurs.

               Concatenation (character, memo): If both operands are
               character, <expC2> (the right operand) is concatenated to
               <expC1> (the left operand) returning a character string.
               Trailing blanks are trimmed from <expC1> and concatenated
               to the end of the return string.


----------------------------------- Examples -------------------------------

   * Binary subtraction (numeric).
   ? 1 - 1                              && Result: 0
   ? 1 - 0                              && Result: 1
   ? 0 - 1                              && Result: -1

   * Binary subtraction (date).
   ? CTOD("12/12/88") - 12              && Result: 11/30/88
   ? 12 - CTOD("12/12/88")              && Result: Expression error

   * Concatenation (character).
   ? "Hi " - "There"                    && Result: Hithere


See Also: * ** + / % Expr_error()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson