Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Nanforum Toolkit v2.1 Reference Guide - <b>ft_doy()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 FT_DOY()
 Find number of day within year
------------------------------------------------------------------------------

 Syntax

      FT_DOY( <dDate> ) -> <nResult>

 Arguments

     <dDate> is a date in the form "mm/dd/yy" or "mm/dd/yyyy"

 Returns

     Return numeric position of day within the year.
     Return NIL if parameter does not conform.

 Description

     Finds the day number, considering 01/01 as day 1
     Handles dates with CENTURY ON|OFF, to allow for 21st century.
     Date validation must be external to this function.

 Examples

     These code fragments find the day number, given a date.

     // literal character date
     dDate  := CTOD("01/01/91")
     nDayNum := FT_DOY(dDate)              // result:  1

     // presume DOS date to be 01/06/91
     nDayNum := FT_DOY(DATE())             // result:  6

     // date input
     cDate  := SPACE(8)
     @ 4,10 get cDate PICT "##/##/##"      // input 07/04/91
     READ
     nDayNum := FT_DOY(CTOD(cDate))        // result: 185

     // last day of year
     nDayNum := FT_DOY(CTOD("12/31/91"))    // result: 365

     For a demonstration of this function, compile and link the
     program WOY.PRG in the Nanforum Toolkit source code.

 Source: WOY.PRG

 Author: Forest Belt, Computer Diagnostic Services, Inc.

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