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 - sfar static far data storage class http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 sfar                Static far data storage class
------------------------------------------------------------------------------
   vardef sfar
      <declarations>
   enddef

 Arguments
   <declarations> is a list of variable declarations.

 Description
   The sfar keyword modifies the storage class of all data objects
   declared in the respective declaration block to become far, and their
   scope to be static. Variables declared in an sfar block are allocated
   in a far data segment, and can be utilized by their symbol name only in
   the source module where they are declared.

   Accessing far data objects results in increased code size and,
   consequently, decreased execution speed, therefore their use is only
   recommended when data segment space is scarce in the application.

 Example
   #define EXAMPLE_KEYWORD
   #include example.hdr

   vardef sfar                // various static far data objects
      char    cString
      uint    aNums[ 30000 ]  // a 60 Kbytes array
      uint    nNum
      logical lLog
      dbl     eBig
   enddef
   
   proc Test_sfar
   cString    := "hello"      // initialize data
   nNum       := 102
   aNums[ 1 ] := 101
   lLog       := .t.
   eBig       := -565.98
   
   ? cString                  // print values
   ? nNum
   ? aNums[ 1 ]
   ? lLog
   ? eBig
   endproc

   proc main
   Test_sfar()
   endproc

See Also: far

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