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 - field field data type modifier http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 field               Field data type modifier
------------------------------------------------------------------------------
 Syntax
   <func>
   param field <datatype> <var>

 Arguments
   <func> is a function or procedure declaration.
   <datatype> is the data type of the parameter.
   <var> is the symbol name of the parameter variable.

 Description
   The field data type modifier declares a parameter as a database
   field. Such parameters can be used with commands that require a field
   variable as an argument. Direct assignments to the field parameter are,
   however, not allowed).

 Example
   #define EXAMPLE_KEYWORD
   #include example.hdr

   dbfdef sTest
      char( 10 ) cfield
   enddef
   
   proc FieldDisplay
   param alias sAlias, field char( 10 ) cField
   // Display contents of field passed as parameter
   vardef
      uint n
   enddef
   !sAlias go top
   for n := 1 to areccount( sAlias )
      ? n, cField                         // show field contents
      !sAlias skip 1                      // next record
   next
   endproc
   
   proc Test_field
   build "stest.dbf" from alias sTest     // make test database
   open "stest.dbf" alias sTest
   append blank                           // add data
   sTest->cfield := "one"
   append blank
   sTest->cfield := "two"
   append blank
   sTest->cfield := "three"
   FieldDisplay( sTest, sTest->cfield )   // display field contents
   close all                              // clean up
   erase "stest.dbf"
   endproc

   proc main
   Test_field()
   endproc

See Also: const

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