First thing you need to realize is the difference between a function
variable and a function. The function variable, see %^CYAN%^%^BOLD%^coding function%^RESET%^,
is used to POINT at a function. You can then use this variable to
referance the actual function being pointed AT by the variable.
Please see %^CYAN%^%^BOLD%^coding function_calling%^RESET%^ to learn about calling a function.

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

Now that you know the difference between a function and a function
variable. I can proceed to explain how to code the actual function.
The following is an overview of the components of a function;

%^MAGENTA%^%^BOLD%^<variable type returned> %^GREEN%^<func. name>%^RESET%^ ( %^ORANGE%^<vars. passed to func>%^RESET%^ ) {

         %^BLUE%^%^BOLD%^<block of statements> 

        }

1) The %^MAGENTA%^%^BOLD%^<variable type returned>%^RESET%^ is the infromation the function will
   return to whatever called the function to execute. It can be any
   variable type as well as the "void" datatype. The void datatype
   means that only a 0 will be returned by the function.

2) The %^GREEN%^<func. name>%^RESET%^ can be almost any alphanumeric string. The 
   standard is to use the _ character to seperate words. This
   name is what will be used by other functions and objects to
   call this function.

3) The %^ORANGE%^<vars. passed to func>%^RESET%^ part is used to define any variables
   that are going to be taking in data for the function to use from
   whatever object/function called it. I will explain this more in
   detail below.

4) The %^BLUE%^%^BOLD%^<block of statements>%^RESET%^ is used for the actions you wish
   the function to perform. You will also have one or more
   return statements included in this section to pass data back
   to whatever object/function called this function. The type
   of data being passed back by the return statement MUST match
   the datatype defined in #1.

5) There is another option that you may set on your functions.
   Please see %^CYAN%^%^BOLD%^coding qualifier%^RESET%^ for more info.
   The qualifiers are an advanced topic. I would recommend getting
   comfortable with coding functions without them until you are
   ready to tackle the topic of inheriting files.

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

Now lets suppose you wish to code a function that will check to
see if a global mapping variable has a certain string set to a
given number. We will use the "skills" as a mock example of this.

int query_skill(string s_name,int s_lvl) {

        if(!my_skills) return 0;
        if(!my_skills[s_name]) return 0;
       return (my_skills[s_name] >= s_lvl) ? 1 : 0;
}

1) First thing you will notice is that the mapping called my_skills
   is not being defined in the function. In a case like this, the
   mapping would have been defined globally. This allows other
   functions to access the variable and affect changes upon it.
   After all, you will want functions that can PUT the info onto
   the mapping as well. See %^CYAN%^%^BOLD%^coding datatypes%^RESET%^ for more info on
   about declaring and defining datatypes. See %^CYAN%^%^BOLD%^coding mapping%^RESET%^ for
   for more info about mappings and their uses.

2) The next thing to note is the passed variables. In a function,
   Any variables that will be holding info from an source outside
   of the function (and isn't a globally defined variable) are
   declared within the %^ORANGE%^<vars. passed to func>%^RESET%^ section.
   Each variable is named and declared here. Note that you can NOT
   assign a value to them at this location. You can however manipulate
   and reassign a value to them from within the function.

3) The "int" in the %^MAGENTA%^%^BOLD%^<variable type returned>%^RESET%^ location is to
   tell LPC what kind of datatype the function will be returning.
   In this case it will be an integer or int datatype.

4) The first if statement checks to see if the global variable
   called my_skills was initiated as a ([]) or is still a 0.
   If it's a 0, then a 0 is returned.

5) The second if test checks to see if there is a key by the name
   of the string passed in as the first arguement to the function.
   If there is no key by the name of the string stored in s_name,
   a 0 will be returned.

6) Finally, a logic_switch is used to test if the value stored on
   the key named by s_name has an >= value to the second arg. passed
   called s_lvl. If the test is true, 1 is returned. If it is false,
   0 is returned. See %^CYAN%^%^BOLD%^coding logical_switches%^RESET%^ for more info
   on this type of testing.

%^CYAN%^%^BOLD%^-----< Special notes on fucntions >-----

1) You may find the qualifier varargs quite handy. It allows you
   to have a variable number of arguements being passed into your
   functions. See %^CYAN%^%^BOLD%^coding varargs%^RESET%^ for more details.
   The other quailfiers are used to affect how functions are
   handled by files that inherit eachother. Do not bother with
   the other qualifiers until you wish to learn the art of 
   inheriting files.

2) You may have anywheres from no args to well over 2 billion args
   if your sadomachochistic enough to code this many. The only thing
   to remember is that when you call the function, you MUST pass as
   many arguements as you have defined in the function's declaration.
   You can vary the number passed by using the varargs qualifier if
   you so desire however. If varargs is not used and you dont pass
   enough arguements, You will get an error returned.

3) You can also have locally declared variables within the function.

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

Ironman
