<<<<<<<<<<<<< Instruction file for the "if" statement >>>>>>>>>>>>>>>>>

The if statement is probably the most widely used statement in the LPC
language. It can be used is a multitude of ways. Please keep in mind
the if statement very often uses it's sister statement called else as well.

%^RED%^%^BOLD%^SYNTAX # 1 :::

    if(%^CYAN%^%^BOLD%^<test>%^RESET%^) %^GREEN%^%^BOLD%^<statement>%^RESET%^ ;

This is the most basic format for an if style test. What this does is
runs a simple %^GREEN%^%^BOLD%^<test>%^RESET%^ like x==5 or y>7. If the test is true, the %^GREEN%^%^BOLD%^<statement>%^RESET%^
is then executed.

%^RED%^%^BOLD%^SYNTAX # 2 :::

    if(%^CYAN%^%^BOLD%^<test>%^RESET%^) {
            %^GREEN%^%^BOLD%^<block of statements>%^RESET%^ }

This works the same as the first syntax with one minor change. Instead of one
statement, it will allow you to execute a series of statements. You do this by 
seperating the statements with the ; just as you would outside of the if 
statement. You must surround the conditional block of statements in { and } 
knows so the compiler that these lines are only to get used if 
the %^CYAN%^%^BOLD%^<test>%^RESET%^ is true.

%^RED%^%^BOLD%^SYNTAX # 3 :::

     if(%^CYAN%^%^BOLD%^<test>%^RESET%^) %^GREEN%^%^BOLD%^<statement>%^RESET%^;
     else %^GREEN%^%^BOLD%^<statement>%^RESET%^;

The if statement here works the same way as in syntax #1. The change is
the use of it's sister statement else. What happens here is if the test is
false then the statement next to else is run, if the test is true the statement
next to the if statement is run. Only one of them will run. Both statements
wouldnt execute at the same time.

%^RED%^%^BOLD%^SYNTAX # 4 :::

    if(%^CYAN%^%^BOLD%^<test>%^RESET%^) {
            %^GREEN%^%^BOLD%^<block of statements>%^RESET%^ }
     else {
            %^GREEN%^%^BOLD%^<block of statements>%^RESET%^ }

This format works just like the second syntax. If the test is true, the
statements in the if's { } are run. If the test is false, then the statements
in the else's { } are run.

%^RED%^%^BOLD%^SYNTAX # 4 :::

    if(%^CYAN%^%^BOLD%^<test #1>%^RESET%^) {
            %^GREEN%^%^BOLD%^<block of statements>%^RESET%^ }
    else if(%^CYAN%^%^BOLD%^<test #2>%^RESET%^) {
            %^GREEN%^%^BOLD%^<block of statements>%^RESET%^ }
     else {
            %^GREEN%^%^BOLD%^<block of statements>%^RESET%^ }

You use this format when you wish to have a series of conditional tests.
If %^CYAN%^%^BOLD%^<test #1>%^RESET%^ is true, then the if statements block of code is run.
if %^CYAN%^%^BOLD%^<test #1>%^RESET%^ is false, then %^CYAN%^%^BOLD%^<test #2>%^RESET%^ is done. If %^CYAN%^%^BOLD%^<test #2>%^RESET%^ is true then
the block of code from the else if is run. If both tests are false, then
the block belonging to the else statement is run.

You may do more than one else if statement in a series. The logic runs the
same as above all the way thru the series of else if's until it reaches the
last one or an else statement.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

                         NOTES ABOUT TESTS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1) These tests can be just about anything. You can compare datatypes. You can
   call functions. You can even assign a value to a variable inside the if
   statement's tests.

2) Two or more tests can be combined inside the if( ). You use the following
   operators to seperate the tests;

         A)    %^CYAN%^%^BOLD%^<test #1>%^RESET%^ && %^CYAN%^%^BOLD%^<test #2>
               Returns true if both tests are true.

         B)    %^CYAN%^%^BOLD%^<test #1>%^RESET%^ || %^CYAN%^%^BOLD%^<test #2>%^RESET%^
               Returns true if either test is true.

         C)    !%^CYAN%^%^BOLD%^%^<test #1>
               Returns true if the test is false.

         D)    %^CYAN%^%^BOLD%^<test #1>%^RESET%^ ^ %^CYAN%^%^BOLD%^<test #2>
               Returns true if one test is true but not both. Commonly known
               as a logical NOR statement.

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

In addition to the if() statement, there is also a #if preprocessor
statement. The difference between the two commands is in when they are
processed. The if statement is processed at runtime. The #if is run when
the object is compiled ( a.k.a -- You update the file. ).

The following statements belong to the conditional preprocessor family;

     #if        #ifdef        #else        #elseif

If you wish to have more information on the preprocessor conditional
statements, Please see %^CYAN%^%^BOLD%^coding conditional_compiling%^RESET%^.

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

Signed, 

     Ironman, The absent-minded professor

