summaryrefslogtreecommitdiff
path: root/ipl/progs/qt.icn
blob: ab9723a89ed0664deb474190ee01b7b722d4a24a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
############################################################################
#
#	File:     qt.icn
#
#	Subject:  Program to announce time in English
#
#	Author:   Robert J. Alexander
#
#	Date:     November 26, 1996
#
############################################################################
#
#   This file is in the public domain.
#
############################################################################
#
#  Usage: qt [-a]
#
#  If -a is present, only the time is printed (for use in scripts), e.g.:
#
#	just after a quarter to three
#
#  otherwise, the time is printed as a sentence:
#
#	It's just after a quarter to three.
#
############################################################################
#
#  Links:  datetime
#
############################################################################

link datetime

procedure main(arg)
   local pre,suf
   if arg[1] == "-a" then {
      pop(arg)
      pre := suf := ""
      }
   else {
      pre := "It's "
      suf := "."
      }
   arg[1] | put(arg)
   every write(pre,saytime(!arg),suf)
end