home *** CD-ROM | disk | FTP | other *** search
- ***************************************************************************
- ** DATES.PRG
- ** (C) Copyright 1990-92, Sub Rosa Publishing Inc.
- **
- ** A demonstration program provided to VP-Info users.
- ** This program may be copied freely. If it is used in commercial code,
- ** please credit the source, Sub Rosa Publishing Inc.
- **
- ** DATES demonstrates the use of DATE() and the DAYS() functions
- ** to generate a wide variety of formated outputs and other information.
- ** DATES is compatible with all current versions of VP-Info.
- **
- ** Sid Bursten and Bernie Melman
- ***************************************************************************
- SET raw off
- SET date to 'MMDDYYYY'
- IF :color <> 7
- SET color to 31; white on blue
- ENDIF
- *
- WINDOW ; set window to full screen
- ERASE ; clear screen
- ? "Today's date in the default format is: ", date(7)
- ? "Today's date in format #1 is: ", date(1)
- ? "Today's date in format #2 is: ", date(2)
- ? "Today's date in format #3 is: ", date(3)
- ? "Today's date in format #4 is: ", date(4)
- ? "Today's date in format #5 is: ", date(5)
- ? "Today's date in format #6 is: ", date(6)
- ? "Today's date in format #8 is: ", date(8)
- ? "Today's date in format #9 is: ", date(9)
- ? "ONLY ",days(date(7),'01012000'),' days left in the 20th century'
- *
- ?
- string=blank(8)
- DO WHILE t
- ? 'Enter a legal date in format MMDDYYYY'
- ACCEPT 'Enter 01011900 to quit.... ' TO string
- IF string='01011900'
- BREAK
- ENDIF
- IF date(1,string)<>' ' ; a blank return means an illegal date
- ? "Selected date in format #1 is: ", date(1,string)
- ? "Selected date in format #2 is: ", date(2,string)
- ? "Selected date in format #3 is: ", date(3,string)
- ? "Selected date in format #4 is: ", date(4,string)
- ? "Selected date in format #5 is: ", date(5,string)
- ? "Selected date in format #6 is: ", date(6,string)
- ? "Selected date in format #8 is: ", date(8,string)
- ? "Selected date in format #9 is: ", date(9,string)
- ? "Number of days to Christmas, 2001 is:"
- ?? pic(days(string,"12/25/2001"),'999,999')
- * note extra characters in date string above are ignored
- ELSE
- ? "ILLEGAL DATE - please be more careful."
- ENDIF
- ENDDO
- CHAIN samples
- *
- * *** end of DATES.PRG ***