home *** CD-ROM | disk | FTP | other *** search
- (external date ;action
- day month year leapyear dayofyear day-name month-name
- days-in-period day-of-week explode)
-
- (call date) ; put todays date into working memory.
-
- (p introductory
- (todays-date <day> <month> <year>)
- -->
- (write (explode |Hello and welcome to |) |OPS5+|(crlf)(crlf))
- (bind <dow> (day-of-week <day> <month> <year>))
- (bind <dayname> (day-name <dow>))
- (bind <monthname> (month-name <month>))
- (bind <doy> (dayofyear <day> <month> <year>))
- (bind <ly> (leapyear <day> <month> <year>))
- (bind <daysleft> (compute 365 + <ly> - <doy>))
- (write |today is| <dayname> <day> <monthname> <year> (crlf)
- |Which| is the <doy> day of the year.
- |Only| <daysleft> days remain this year (crlf)(crlf)))
-
- ; End of C interface example.