home *** CD-ROM | disk | FTP | other *** search
/ RBBS in a Box Volume 1 #2 / RBBS_vol1_no2.iso / 003z / today.prg < prev    next >
Text File  |  1984-09-25  |  3KB  |  85 lines

  1. ************************************************************
  2. *                                                          *
  3. *  TODAY.PRG    created by John Chidester                  *
  4. *                          5515 N. 7th Street, Suite 5-169 *
  5. *                          Phoenix, AZ 85014               *
  6. *                                                          *
  7. *  Requires dBaseII  (Ver 2.4) (May work with earlier)     *
  8. *                                                          *
  9. *  This program converts system date to month, day, year   *
  10. *  format (i.e. "September 24, 1984") from the standard    *
  11. *  09/24/84 format. This program may be called from your   *
  12. *  dBase II program (DO TODAY) or you may 'merge' this     *
  13. *  program within your program (seems to run faster that   *
  14. *  way). The end result is a variable called 'today' which *
  15. *  stores the current date in the new format. You can then *
  16. *  use this new date format on screen or in your printed   *
  17. *  reports. Looks a lot better and less cryptic!.          *
  18. *                                                          *
  19. ************************************************************
  20. ****** If the operator forgot to set the date when booting up
  21. *      the first 'IF..ENDIF' will get the date.
  22. IF DATE()='01/01/80'
  23.    ERASE
  24.    STORE '        ' TO TODAY
  25.    @ 10,10 SAY "What is today's date? (MM/DD/YY) " GET TODAY ;
  26.    PICTURE '##/##/##'
  27.    READ
  28. ELSE
  29.    STORE DATE() TO TODAY
  30. ENDIF
  31. ****** YOU MAY WANT TO CONVERT THIS SERIES OF 'IF...ENDIF' TO A 'CASE'
  32. *      SERIES OF STATEMENTS
  33. IF $(TODAY,1,2)='01'
  34.    STORE 'January' to month
  35. ENDIF
  36. IF $(TODAY,1,2)='02'
  37.    STORE 'February' TO MONTH
  38. ENDIF
  39. IF $(TODAY,1,2)='03'
  40.    STORE 'March' TO MONTH
  41. ENDIF
  42. IF $(TODAY,1,2)='04'
  43.    STORE 'April' TO MONTH
  44. ENDIF
  45. IF $(TODAY,1,2)='05'
  46.    STORE 'May' TO MONTH
  47. ENDIF
  48. IF $(TODAY,1,2)='06'
  49.    STORE 'June' TO MONTH
  50. ENDIF
  51. IF $(TODAY,1,2)='07'
  52.    STORE 'July' TO MONTH
  53. ENDIF
  54. IF $(TODAY,1,2)='08'
  55.    STORE 'August' TO MONTH
  56. ENDIF
  57. IF $(TODAY,1,2)='09'
  58.    STORE 'September' TO MONTH
  59. ENDIF
  60. IF $(TODAY,1,2)='10'
  61.    STORE 'October' TO MONTH
  62. ENDIF
  63. IF $(TODAY,1,2)='11'
  64.    STORE 'November' TO MONTH
  65. ENDIF
  66. IF $(TODAY,1,2)='12'
  67.    STORE 'December' TO MONTH
  68. ENDIF
  69. STORE $(TODAY,4,2) TO DAY
  70. IF $(DAY,1,1)='0'
  71. STORE $(DAY,2,1) TO DAY
  72. ENDIF
  73. STORE $(TODAY,7,2) TO YEAR
  74. STORE '19'+YEAR TO YEAR
  75. STORE MONTH+' '+DAY+', '+YEAR TO TODAY
  76. RELEASE MONTH, DAY, YEAR
  77. ****** The next statement stores the date to a MEM file so
  78. *      that you can restore it later (after a 'CLEAR').
  79. SAVE TO TODAY.MEM ALL LIKE TODAY
  80. ****** If you merge this program in yours, delete the RETURN
  81. RETURN
  82. ***************************************************
  83. ***************************************************
  84. ***************************************************