comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <Stephen.A.Leake@nasa.gov>
Subject: phone number database
Date: 27 Feb 2003 12:26:50 -0500
Date: 2003-02-27T17:40:43+00:00	[thread overview]
Message-ID: <uk7fliqhx.fsf_-_@nasa.gov> (raw)
In-Reply-To: kQj7a.72$QK.31@read3.inet.fi

"Anders Wirzenius" <anders.wirzenius@pp.qnet.fi> 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



  parent reply	other threads:[~2003-02-27 17:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-26 18:00 Variant Record Component John Harbaugh
2003-02-26 19:08 ` Stephen Leake
2003-02-27  8:17   ` Anders Wirzenius
2003-02-27  8:46     ` John McCabe
2003-02-27 17:26     ` Stephen Leake [this message]
2003-02-27 18:09       ` phone number database tmoran
2003-02-28  0:07       ` Matthew Heaney
2003-02-28  6:46       ` Hijacking threads (was phone number database (was Variant Record Component)) Anders Wirzenius
2003-02-26 20:50 ` Variant Record Component David C. Hoos
2003-02-28 16:15   ` John Harbaugh
2003-02-28 18:18     ` tmoran
2003-02-28 22:07       ` John Harbaugh
2003-02-28 20:51     ` Randy Brukardt
2003-03-01  2:34     ` Jeffrey Carter
2003-03-03  9:24     ` John McCabe
2003-02-26 21:37 ` tmoran
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox