comp.lang.ada
 help / color / mirror / Atom feed
From: "Anders Wirzenius" <anders.wirzenius@pp.qnet.fi>
Subject: Re: Variant Record Component
Date: Thu, 27 Feb 2003 08:17:20 GMT
Date: 2003-02-27T08:17:20+00:00	[thread overview]
Message-ID: <kQj7a.72$QK.31@read3.inet.fi> (raw)
In-Reply-To: uof4y507a.fsf@nasa.gov

"Stephen Leake" <Stephen.A.Leake@nasa.gov> wrote in message news:uof4y507a.fsf@nasa.gov...
> John Harbaugh <john.s.harbaugh2@boeing.com> writes:
> 
> > Hi, all -
> > 
> > Is there a way to determine if an object of some variant record type
> > contains a specific variant component, other than a trying it and
> > handling a possible constraint error?  I looked for something like and
> > "in" operator or suitable attribute, but found nothing.
> 
> The discriminant of a variant record tells you what components are
> present, but that information is essentially hard-coded everywhere.
> 
> It sounds like you want to do introspection or something. ASIS is
> good for that, but not at run time.
> 
> Perhaps if you give a higher level view of what you are trying to do,
> I could be more helpful.
> 
> -- 
> -- Stephe

Sorry, John, for using your thread as a stepping-stone. ;-(

Here, Stephe, is another higher level description:

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.
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" ? 


Anders





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

Thread overview: 17+ 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 [this message]
2003-02-27  8:46     ` John McCabe
2003-02-27 17:26     ` phone number database Stephen Leake
2003-02-27 18:09       ` 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
  -- strict thread matches above, loose matches on Subject: below --
2003-02-28 19:40 David C. Hoos
replies disabled

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