Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - () function indicator http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 ()                  Function indicator
------------------------------------------------------------------------------
 Syntax
   <func>( [<arguments>] )

 Arguments
   <func> is a procedure or function name, or the name of a pointer
   to a procedure or function.

   <arguments> is one or more parameters, depending on the prototype of
   the respective function or procedure.

 Description
   The () operator indicates that the symbol preceding the operator
   is a function or procedure (or a pointer to these), to be called with
   the optional <arguments> at the place of specification.

   Force functions are much like procedures, with the exception that
   functions return a data type value. The returned values are as
   expressions, as they may be assigned, combined into larger
   expressions, and evaluated just like other Force expressions. The
   value returned by a function can be used just like the value of any
   variable of the same data type.

   There are many ways to receive the value that a function returns. The
   return value can also be ignored, in which case the compiler issues a
   warning that can be suppressed by the #pragma W_FUNC_PROC- directive.

 Example
   #define EXAMPLE_OPERATOR
   #include example.hdr

   proc Test_948
   #pragma W_FUNC_PROC+              // enable warning
   ? "Press a key..."
   getkey()                          // ignore return value of function
   ? chr( lastkey() )                // use return value of functions
   delay( 3 )                        // ignore return value of function
   // call procedure with parameter
   dispcolor( row(), col(), "end", __syscolor[ CLR_STD ] )
   endproc

   proc main
   Test_948()
   endproc

See Also: func

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