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 - daysfrom() return a date that is a number of days from a date http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 daysfrom()          Return a date that is a number of days from a date
------------------------------------------------------------------------------
 Declaration
   date.hdr

 Syntax
   func date daysfrom extern
   param value date dDate, ;
         value long gDays

 Arguments
   dDate is the date to calculate days from.
   gDays is the number of days.

 Return
   The date calculated from the passed parameters.

 Description
   The daysfrom() function returns a date that is gDays days from the date
   dDate.

 Example
   #define EXAMPLE_DATE
   #include example.hdr

   func date WeekDay
   param value date dStart, value int nDays
   /*
   This example encodes a function that returns the date of a "recall"
   (i. e., a check-up) ensuring the date falls on a weekday.
   */
   vardef
      date dTemp
      int  nBias
   enddef
   nBias := 0
   dTemp := daysfrom( today(), nDays )
   if dow( dTemp ) == 1                   // Sunday?
      nBias := 1                          // goes to Monday
   endif
   if dow( dTemp ) == 7                   // Saturday?
       nBias := 2                         // goes to Monday
   endif
   return( daysfrom( dTemp, nBias ) )
   endfunc
   
   proc Test_daysfrom
   // Print the maturity date of 90-day T-bills
   ? "Bonds issued on", today(), "mature on", daysfrom( today(), 90 )
   ? weekday( today(), 20 )
   endproc

   proc main
   Test_daysfrom()
   endproc

See Also: daysbtwdates()

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