From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e8550e5b10c2c0 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-27 09:27:07 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: phone number database Date: 27 Feb 2003 12:26:50 -0500 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: <3E5D00D6.F6A20AD2@boeing.com> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1046367643 10595 128.183.235.92 (27 Feb 2003 17:40:43 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 27 Feb 2003 17:40:43 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:34681 Date: 2003-02-27T17:40:43+00:00 List-Id: "Anders Wirzenius" writes: > Sorry, John, for using your thread as a stepping-stone. ;-( Please learn how to change the subject in your newsreader; hijacking threads like this is simply not acceptable. > I HAVE: > 1. > Six phone numbers: 1795, 2006, 2007, 2012, 2013, 2014. > 2. > A log (text file) from the company's phone system with data like: > From_Phone_Nr, To_Phone_Nr, Answering_Time, Duration... > > I WANT TO: > 3. > Pick only those log data where the To_Phone_Nr is one of the six numbers. > 4. > Set up some statistics about those phone calls. > 5. > Be able to add or remove phone numbers from the list (six becomes > seven some sunny winterday). > > I WISH I HAD: > type Help_Desk is (1795, 2006, 2007, 2012, 2013, 2014); -- with the > dynamics described under point 5. Well, since Ada enumeration types don't have the dynamics from point 5, you can't use them. > If To_Phone_Nr in Help_Desk then > -- Do statistics > end if; > > What is a proper way to implement "To_Phone_Nr in Help_Desk" ? Use a SAL binary tree (http://users.erols.com/leakstan/Stephe/Ada/Sal_Packages/index.htm) to store the help desk phone numbers; then do if Is_Present (Help_Tree, To_Phone_Nr) then ... end if; Hmm, my web page is out of date; that version doesn't have Is_Present. I'll update it one of these days... -- -- Stephe