home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / sri314_b.zip / DEMOPRGS.ZIP / DATES.PRG < prev    next >
Text File  |  1990-09-30  |  2KB  |  59 lines

  1. ***************************************************************************
  2. **  DATES.PRG
  3. **  A demonstration program provided by  SUB ROSA PUBLISHING INC.
  4. **  (C) Copyright 1990, Sub Rosa Publishing Inc.
  5. **  This program may be copied freely. If it is used in commercial code,
  6. **  please credit the source, Sub Rosa Publishing Inc.
  7. **
  8. **  DATES demonstrates the use of DATE() and the DAYS() functions
  9. **  to generate a wide variety of formated outputs and other information.
  10. **  DATES is compatible with all current versions of SR-Info and VP-Info.
  11. **
  12. **  Bernie Melman
  13. ** 
  14. ***************************************************************************
  15. SET raw off
  16. IF :color <> 7
  17.    SET color to 31; white on blue
  18. ENDIF
  19. *
  20. WINDOW ; set window to full screen
  21. ERASE  ; clear screen
  22. ? "Today's date in the default format is: ", date(7)
  23. ? "Today's date in format #1 is: ", date(1)
  24. ? "Today's date in format #2 is: ", date(2)
  25. ? "Today's date in format #3 is: ", date(3)
  26. ? "Today's date in format #4 is: ", date(4)
  27. ? "Today's date in format #5 is: ", date(5)
  28. ? "Today's date in format #6 is: ", date(6)
  29. ? "Today's date in format #8 is: ", date(8)
  30. ? "Today's date in format #9 is: ", date(9)
  31. ? "ONLY ",days(date(7),'01012000'),' days left in the 20th century'
  32. *
  33. ?
  34. string=blank(8)
  35. DO WHILE t
  36.    ? 'Enter a legal date in format MMDDYYYY'
  37.    ACCEPT 'Enter 01011900 to quit.... ' TO string
  38.    IF string='01011900'
  39.       BREAK
  40.    ENDIF
  41.    IF date(1,string)<>' ' ; a blank return means an illegal date
  42.       ? "Selected date in format #1 is: ", date(1,string)
  43.       ? "Selected date in format #2 is: ", date(2,string)
  44.       ? "Selected date in format #3 is: ", date(3,string)
  45.       ? "Selected date in format #4 is: ", date(4,string)
  46.       ? "Selected date in format #5 is: ", date(5,string)
  47.       ? "Selected date in format #6 is: ", date(6,string)
  48.       ? "Selected date in format #8 is: ", date(8,string)
  49.       ? "Selected date in format #9 is: ", date(9,string)
  50.       ? "Number of days to Christmas, 2001 is:"
  51.       ?? pic(days(string,"12\25\2001"),'999,999') 
  52. * note extra characters in date string above are ignored
  53.    ELSE
  54.       ? "ILLEGAL DATE - please be more careful."
  55.    ENDIF
  56. ENDDO
  57. *
  58. *                        *** end of DATES.PRG ***
  59.