6.7 LPC operators
This section contains a detailed listing of the simpler LPC operators,
including what they do to the values they use (if anything) and the value
that they have.

The operators described here are:
=    +    -    *    /    %    +=    -=    *=    /=    %=
--    ++    ==    !=    >    <    >=    <=    !    &&    ||
->    ? :

Those operators are all described in a rather dry manner below, but it is best
to at least look at each one, since some may not behave *exactly* as
you think.  But it should make a rather good reference guide.

%^CYAN%^%^BOLD%^=         assignment operator:
    example: x = 5;
    value: the value of the variable on the *left* after its function is done
    explanation: It takes the value of any expression on the *right* and
      assigns it to the variable on the *left*.  Note that you must use
      a single variable on the left, as you cannot assign values to 
      constants or complex expressions.

%^CYAN%^%^BOLD%^+         addition operator:
    example: x + 7
    value: The sum of the value on the left and the value on the right
    exaplanation: It takes the value of the expression on the right and
      adds it to the value of the expression on the left. For values
      of type int, this means the numerical sum.  For strings,
      it means that the value on the right is stuck onto the value on
      the left ("ab" is the value of "a"+"b").  This operator does not
      modify any of the original values (i.e. the variable x from
      above retains its old value).

%^CYAN%^%^BOLD%^-         subtraction operator:
    example: x - 7
    value: the value of the expression on the left reduced by the right
    explanation:  Same characteristics as addition, except it subtracts.
      With strings: "a" is the value of "ab" - "b"

%^CYAN%^%^BOLD%^*         multiplication operator:
    example: x*7
    value and explanation: same as with adding and subtracting except
      this one performs the math of multiplication

%^CYAN%^%^BOLD%^/         division operator:
    example: x/7
    value and explanation: see above

%^CYAN%^%^BOLD%^+=        additive assignment operator:
    example: x += 5
    value: the same as x + 5
    exaplanation: It takes the value of the variable on the left
      and the value of the expression on the right, adds them together
      and assigns the sum to the variable on the left.
      example: if x = 2... x += 5 assigns the value
        7 to the variable x.  The whole expression
        has the value of 7.

%^CYAN%^%^BOLD%^-=        subtraction assignment operator
    example: x-=7
    value: the value of the left value reduced by the right value
    examplanation: The same as += except for subtraction.

%^CYAN%^%^BOLD%^*=        multiplicative assignment operator
    example: x *= 7
    value: the value of the left value multiplied by the right
    explanation: Similar to -= and += except for addition.

%^CYAN%^%^BOLD%^/=        division assignment operator
    example: x /= 7
    value: the value of the variable on the left divided by the right value
    explanation: similar to above, except with division

%^CYAN%^%^BOLD%^++        post/pre-increment operators
    examples: i++ or ++i
    values: 
      i++ has the value of i
      ++i has the value of i+1
    explanation: ++ changes the value of i by increasing it by 1.
      However, the value of the expression depends on where you
      place the ++.  ++i is the pre-increment operator.  This means
      that it performs the increment *before* giving a value.
      i++ is the post-ncrement operator.  It evalutes before incrementing
      i.  What is the point?  Well, it does not much matter to you at
      this point, but you should recognize what it means.

%^CYAN%^%^BOLD%^--        post/pre-decrement operators
    examples: i-- or --i
    values:
      i-- the value of i
      --i the value of i reduced by 1
    explanation: like ++ except for subtraction

%^CYAN%^%^BOLD%^==        equality operator
    example: x == 5
    value: true or false (not 0 or 0)
    explanation: it does nothing to either value, but
      it returns true if the 2 values are the same.
      It returns false if they are not equal.

%^CYAN%^%^BOLD%^!=        inequality operator
    example: x != 5
    value: true or false
    explanation returns true if the left expression is not equal to the right
      expression.  It returns fals if they are equal

%^CYAN%^%^BOLD%^>          greater than operator
    example: x > 5
    value: true or false
    explanation: true only if x has a value greater than 5
      false if the value is equal or less

%^CYAN%^%^BOLD%^<         less than operator
%^CYAN%^%^BOLD%^>=        greater than or equal to operator
%^CYAN%^%^BOLD%^>=        less than or equal to operator
    examples: x < y    x >= y    x <= y
    values: true or false
    explanation: similar as to > except
      < true if left is less than right
      >= true if left is greater than *or equal to* right
      <= true if the left is less than *or equal to* the right

%^CYAN%^%^BOLD%^&&         logical and operator
%^CYAN%^%^BOLD%^||        logical or operator
    examples: x && y      x || y
    values: true or false
    explanation: If the right value and left value are non-zero, && is true.
      If either are false, then && is false.
      For ||, only one of the values must be true for it to evaluate
      as true.  It is only false if both values indeed
      are false

%^CYAN%^%^BOLD%^!         negation operator
    example: !x
    value: true or false
    explanation: If x is true, then !x is false
      If x is false, !x is true.

=======================================================================

The last two operators are used in special cases. Please see the coding
files on them for more details. I am just introducing them here in this
file.

%^CYAN%^%^BOLD%^->          The call_other operator

       You use this operator to call functions present inside another
       object. Please see the coding files for functions for more
       details on writting and calling functions from within your objects.

%^CYAN%^%^BOLD%^? :         The conditonal or Logical Switch operator

        This is an extreamly powerful operator. It allows you to assign
        a value based on the outcome of an if style test. The easy way
        to understand this operator is to view it like a shorthand way
        of writting if/else tests. Please see the coding file for 
        logical_switches for more details.

=======================================================================

                       ADVANCED CODING NOTES
=======================================================================
1) You may define a value to a variable when you declare the variable.
        EX ::       object TP=this_player();

        This Declared the variable TP to be an object datatype and
        assigned the value of this_player() to the variable.

2) You may perform operations in the declariation statement for variables.
        EX ::       int my_lvl=( TP->query_level() ) + 5;

         This statement has used the TP declared in #1 and used the ->
         I mentioned to "call_other" upon the object TP. It then adds
         5 to the results of TP->query_level() and stores it in your
         newly declared variable my_lvl.

3) You may use the logical_switch operator to do a if test INSIDE of
    the declaration statement of a variable. Don't attempt this kind
    of coding until you are experianced with the if/else statements.
    It is a very fast, clean and compact way to code. However, It
    sometimes leads to confusion when another comes to read your files.

         EX ::  string my_name= ( TP->query_race()=="elf" ) ?
                       "larry" : "moe" ;

         This statement has used the variable TP from #1 and -> to
        call the function within the object this_player(). IF the
        race of this_player() is an elf, the string variable
        my_name is set to "larry". If it is not "elf" then my_name
        is set to "moe".

        PLEASE see the coding file for logical_switches for more
         details and samples of this kind of coding.

=======================================================================

Any questions ?? Please feel free to come and talk to me or any
archwizard.

Ironman
