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 - set century control the century flag http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 set century         Control the century flag
------------------------------------------------------------------------------
 Syntax
   set century on|off

 Arguments
   None.

 Description
   The set century command controls the century flag.

   on specifies display of the year date variable in four digits rather than
   two digits, affecting display of a date value, not its storage in a field.

   off specifies display of the year date variable in two digits - the
   default setting for the set century flag.

   The get system automatically adds 1900 to any year less than 100,
   regardless of the set century flag.

 Example
   #define EXAMPLE_DATE
   #include example.hdr

   proc Test_setcentury
   vardef
      date dTemp2, dTemp4
   enddef
   dTemp2 := today()
   dTemp4 := today()
   // set century affects the number of digits to be edited during a get
   clear
   set century on
   @ 1,0 get dTemp4       // edit date with 4 digit year
   set century off
   @ 2,0 get dTemp2       // edit date with 2 digit year
   read
   set century on
   ? dTemp2, dTemp4       // display 4 digit year
   set century off
   ? dTemp2, dTemp4       // display 2 digit year
   endproc

   proc main
   Test_setcentury()
   endproc

See Also: getcentury()

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