comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <dont.bother.mcondic.auntie.spam@[acm.org>
Subject: Re: How would i keep 'records' in ADA ?
Date: Mon, 11 Mar 2002 10:39:24 -0500
Date: 2002-03-11T15:39:22+00:00	[thread overview]
Message-ID: <a6ij3a$3ci$1@nh.pace.co.uk> (raw)
In-Reply-To: yyIi8.12364$xO2.961959@news11-gui.server.ntli.net

Its also important to ask if it is necessary to maintain the data in some
kind of sorted order. A random set of customer records in no particular
order would make the suggested technique of marking unused space - or
linking together unused space attractive. (Simple and efficient). If the
requirement is to be able to list everything in order (alphabetical on
customer last name?) then the problem is somewhat different & this technique
becomes less useful.

If the project is not a class project (wherein you can utilize someone
else's code and not be doing something wrong) then its probably easier to
make use of one of the many data structure packages available that would
provide a linked list. If this is the case, we can probably point you at a
few dozen prepackaged solutions...

MDC
--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com
Web:      http://www.mcondic.com/


"chris.danx" <chris.danx@ntlworld.com> wrote in message
news:yyIi8.12364$xO2.961959@news11-gui.server.ntli.net...
>
> For simplicity use arrays (your just learning, right? So why
overcomplicate
> things with linked lists, SQL etc?  That's just silly).
>
> Do as T(?) Moran suggested and have some kind of unreasonable name (a name
> with '-' at the beginning would be funny peculiar so it's a good choice)
to
> check for.  If it's that name then that record is deleted, or not in use.
>
> use a function like
>
> function is_empty (x : in my_record) return boolean is
> begin
>    ...
> end is_empty;
>
> that will check for this condition.
>
> If you need to save records to a file, you can just walk the array and
write
> the non-empty items to the file (the type of file depends on the
> specification, but a text file is easy to begin with).  Reading them from
a
> file is easier.
>
>
> HTH,
> Chris
>
>





  reply	other threads:[~2002-03-11 15:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-09 22:35 How would i keep 'records' in ADA ? Jim
2002-03-09 23:29 ` chris.danx
2002-03-09 23:32   ` chris.danx
2002-03-10  0:33     ` Jim
2002-03-10  2:00       ` tmoran
2002-03-10  6:51       ` Jeffrey Carter
2002-03-10 12:14       ` rmoldskr
2002-03-11 15:33         ` Marin David Condic
2002-03-10 12:45       ` chris.danx
2002-03-11 15:39         ` Marin David Condic [this message]
2002-03-10 12:03 ` David C. Hoos, Sr.
replies disabled

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