home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / historic / v941.tgz / icon.v941src.tar / icon.v941src / ipl / progs / qt.icn < prev    next >
Text File  |  2000-07-29  |  1KB  |  48 lines

  1. ############################################################################
  2. #
  3. #    File:     qt.icn
  4. #
  5. #    Subject:  Program to announce time in English
  6. #
  7. #    Author:   Robert J. Alexander
  8. #
  9. #    Date:     November 26, 1996
  10. #
  11. ############################################################################
  12. #
  13. #   This file is in the public domain.
  14. #
  15. ############################################################################
  16. #
  17. #  Usage: qt [-a]
  18. #
  19. #  If -a is present, only the time is printed (for use in scripts), e.g.:
  20. #
  21. #    just after a quarter to three
  22. #
  23. #  otherwise, the time is printed as a sentence:
  24. #
  25. #    It's just after a quarter to three.
  26. #
  27. ############################################################################
  28. #
  29. #  Links:  datetime
  30. #
  31. ############################################################################
  32.  
  33. link datetime
  34.  
  35. procedure main(arg)
  36.    local pre,suf
  37.    if arg[1] == "-a" then {
  38.       pop(arg)
  39.       pre := suf := ""
  40.       }
  41.    else {
  42.       pre := "It's "
  43.       suf := "."
  44.       }
  45.    arg[1] | put(arg)
  46.    every write(pre,saytime(!arg),suf)
  47. end
  48.