comp.lang.ada
 help / color / mirror / Atom feed
* about ADTs
@ 2001-07-19 20:38 Beau
  2001-07-20 16:28 ` Stephen Leake
  0 siblings, 1 reply; 2+ messages in thread
From: Beau @ 2001-07-19 20:38 UTC (permalink / raw)


In the child package for an ADT I need to get an enumerated type. Would I
instantiate a package to read the enumerated data inside the child package?
How would I write the child package get? would it look like this:
--in the spec file for the child package
PROCEDURE Get(File : IN Ada.Text_IO.File_Type;
                                  Item : OUT Account);  --Account is a
record containing a seperate ADT value Date, the
                                                                         --e
numeration type and a float value

--then inside the body of the child package:
PROCEDURE Get(File : IN Ada.Text_IO.File_Type;
                                   Item : OUT Account) IS
    --here I would get the Dates from the other ADT package I am using
    --here is where I would get the enumeration type
    Enumeration_IO.Get( Item => TransKind);
    --Here I get the Amount
    Ada.Integer_Text_IO.Get(Item => Amount);

END Get;

does this look remotely right?

--
~Beau~
beau@hiwaay.net






^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-07-20 16:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-19 20:38 about ADTs Beau
2001-07-20 16:28 ` Stephen Leake

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