summaryrefslogtreecommitdiff
path: root/ipl/progs/adlcount.icn
blob: e47d3ff55e7324db918e19ea579ecc7922c56bc7 (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
############################################################################
#
#	File:     adlcount.icn
#
#	Subject:  Program to count address list entries
#
#	Author:   Ralph E. Griswold
#
#	Date:     November 19, 1997
#
############################################################################
#
#   This file is in the public domain.
#
############################################################################
#
#     This program counts the number of entries in an address list file.
#  If an argument is given, it counts only those that have designators
#  with characters in the argument. Otherwise, it counts all entries.
#
############################################################################
#
#  See also: address.doc, adlcheck.icn, adlfiltr.icn, adllist.icn,
#     adlsort,icn, labels.icn
#
############################################################################

procedure main(arg)
   local s, count

   s := cset(arg[1]) | &cset

   count := 0
   every !&input ? {
      any('#') & upto(s) \ 1
      } do
      count +:= 1
   write(count)

end