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 - {} literal array delimiters http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 {}                  Literal array delimiters
------------------------------------------------------------------------------
 Syntax
   { <constants> }

 Arguments
   <constants> is a list of constant values for initializing the array.

 Description
   The {} operators are used to delimit array initializer values when
   declaring an array member of a public or static structure.

 Example
   #define EXAMPLE_OPERATOR
   #include example.hdr

   typedef struct PERSON
      uint       nAge
      char( 10 ) cName[ 2 ]           // array member in structure
      logical    lMale
   enddef
   
   vardef static
      PERSON sData := 28, { "John", "Smith" }, .t.  // initialize
   enddef
   
   proc Test_947
   ? "Name is", sData.cName[ 0 ], sData.cName[ 1 ]
   ? "Age is", istr( sData.nAge )
   ? "Sex is", iifc( sData.lMale, "man", "woman" )
   endproc

   proc main
   Test_947()
   endproc

See Also: . typedef struct

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