comp.lang.ada
 help / color / mirror / Atom feed
From: "Zebylon" <sebastian.madunic@esavionics.se>
Subject: Confused about Attribute Size?
Date: Tue, 22 Jan 2002 08:39:01 +0100
Date: 2002-01-22T08:39:01+01:00	[thread overview]
Message-ID: <a2j3lh$5nt$1@newstoo.ericsson.se> (raw)

Hi,

I'm a newbie in Ada but I saw an Ada example that confused me a bit, here it
is:

type My_Type is
    (startbit,
     endbit,
     timeout,
     spare,
     nextbit,
     ......
     ......
     lastbit);

for My_Type use
    (startbit =>0,
     endbit=>1,
     timeout=>2,
     spare=>3,
     nextbit=>4,
     ......
     ......
     lastbit=>15);

for My_Type'Size use 8;

type My_Type_Array is array (My_Type) of Boolean;

What I don't understand is how you can assign the size to 8 bits? How will
this work when
there are 16 bits in the type? What will be the size of the array?
This example was in Ada 83 could this be a clue?

Thanks

/S






             reply	other threads:[~2002-01-22  7:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-22  7:39 Zebylon [this message]
2002-01-22 19:08 ` Confused about Attribute Size? Patrick Hohmeyer
2002-01-22 22:56 ` Mark Johnson
2002-01-23  2:20   ` Jeffrey Carter
2002-01-23 14:56     ` Mark Johnson
2002-01-23 17:06       ` Jeffrey Carter
2002-01-24  4:11         ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
2002-01-22  8:00 Christoph Grein
replies disabled

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