home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast.iso / pcmag / vol13n05.zip / NDY2.PRG < prev    next >
Text File  |  1993-12-09  |  1KB  |  38 lines

  1. FUNCTION ndy1
  2. PARAMETERS D
  3. D=IIF(PARAM()=0,DATE(),D)
  4. RETURN PADL((D+1)-CTOD("1/1/"+;
  5.   STR(YEAR(D))),3,"0")
  6.  
  7.  
  8. FUNCTION ndy2
  9. PARAMETERS D
  10. D=IIF(PARAM()=0,DATE(),D)
  11. RETURN IIF(EMPTY(D) OR ;
  12.    TYPE("d")#"D","Inv",;
  13.    PADL((D+1)-CTOD("1/1/"+;
  14.    STR(YEAR(D))),3,"0"))
  15.  
  16.  
  17. *****************************************************************
  18. * FUNCTION ndy                                        FoxPro
  19. * Returns a character string of length 3, left padded with zeros
  20. * reflecting the number of the day of the year: 001-365 or 366.
  21. *****************************************************************
  22. FUNCTION ndy
  23. PARAMETER D
  24. boy = CTOD("01/01/"+STR(YEAR(IIF(EMPTY(D),DATE(),D))))
  25. RETURN PADL(((D - boy) + 1),3,'0')
  26.  
  27. *****************************************************************
  28. * FUNCTION ndyc      Includes parameter check          FoxPro
  29. * Returns a character string of length 3, left padded with zeros
  30. * reflecting the number of the day of the year: 001-365 or 366.
  31. *****************************************************************
  32. *****************************************************************
  33. FUNCTION ndyc
  34. PARAMETER D
  35. boy = CTOD("01/01/"+STR(YEAR(IIF(PARAM()=0,DATE(),D))))
  36. RETURN IIF(EMPTY(D) OR TYPE("d")#"D","Inv",;
  37.         PADL(((D - boy) + 1),3,'0'))
  38.