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 - proc procedure declaration or definition http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 proc                Procedure declaration or definition
------------------------------------------------------------------------------
 Syntax
   proc <symbol> [<scope>]
   [ <params> ]
   [ <code> ]
   endproc

 Arguments
   <symbol> is the name of the procedure.
   <scope> is the range of visibility for the procedure.
   <params> is a parameter declaration.
   <code> is the body of code belonging to the procedure.

 Description
   The proc keyword initiates a procedure declaration. Procedures
   are identical to functions in every respect except that they do not
   return a value.

 Example
   #define EXAMPLE_KEYWORD
   #include example.hdr

   proc MsgAdd static
   param char cMsg
   if len( cMsg ) < 245
      cMsg += " world"
   endif
   endproc
   
   proc Test_proc
   vardef
      char cMessage
   enddef
   cMessage := "Hello"
   MsgAdd( cMessage )
   ? cMessage
   endproc

   proc main
   Test_proc()
   endproc

See Also: () func

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