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 - public global data storage class http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 public              Global data storage class
------------------------------------------------------------------------------
 Syntax
   func|proc [<type>] <symbol> public                                                       #

   defblock [<symbol>] public

 Arguments
 Arguments
   <symbol> is a symbol identifier.
   <type> is a data type.
   <defblock> is a declaration lock.

 Description
   The public keyword sets the scope of the respective symbol to
   public. Public is the default scope for symbols declared outside of a
   function body, so its use is optional. Public symbols are accessible
   in all modules of the application where they are either defined, or
   declared as extern, from their place of declaration to the end of the
   source code module.

 Example
   #define EXAMPLE_KEYWORD
   #include example.hdr

   // Use of the optional public keyword is suggested for clarity.
   
   dbfdef sTest public
      char( 10 ) name
      uint( 3 )  age
   enddef
   
   vardef public
      char( 20 ) cName := "Lola"
   enddef
   
   vardef              // variables declared in this block are public as well
      char( 15 ) cCity := "New Jersey"
   enddef
   
   proc Test_public
   ? cName, cCity
   endproc

   proc main
   Test_public()
   endproc

See Also: extern far sfar static

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