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

 Arguments
   <declarations> is a list of variable declarations.

 Description
   The far keyword modifies the storage class of all data objects
   declared in the respective declaration block to become far. Far data
   objects are allocated in a segment different from the default data
   segment, thus saving space in it. Each module has its own far data
   segment, which can be up to 64 Kbytes large.

   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.

   Variables declared as far are not accessible from other modules written
   in Force, only from C or ASM code.

 Example
   #define EXAMPLE_KEYWORD
   #include example.hdr

   vardef far                 // various far data objects
      char    cString
      uint    aNums[ 30000 ]  // a 60 Kbytes array
      uint    nNum
      logical lLog
      dbl     eBig
   enddef
   
   proc Test_far
   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_far()
   endproc

See Also: public sfar

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