comp.lang.ada
 help / color / mirror / Atom feed
* Re: Zero length Objects
@ 2004-07-02  8:30 Christoph Karl Walter Grein
  2004-07-06 11:59 ` Nick Roberts
  0 siblings, 1 reply; 30+ messages in thread
From: Christoph Karl Walter Grein @ 2004-07-02  8:30 UTC (permalink / raw)
  To: comp.lang.ada

There are types needing no space, but objects cannot have zero size.
_______________________________________________________
WEB.DE Video-Mail - Sagen Sie mehr mit bewegten Bildern
Informationen unter: http://freemail.web.de/?mc=021199




^ permalink raw reply	[flat|nested] 30+ messages in thread
* Zero length Objects
@ 2004-06-30  5:55 Robert C. Leif
  2004-06-30 20:32 ` Jacob Sparre Andersen
  2004-06-30 21:01 ` Frank J. Lhota
  0 siblings, 2 replies; 30+ messages in thread
From: Robert C. Leif @ 2004-06-30  5:55 UTC (permalink / raw)
  To: Comp. Lang. Ada

I am trying to create a means to report the value of experimental
parameters.  I would like to store only those parameters that I have
selected.  Since thanks to Robert I. Eachus, I am using a variant record, I
can set the parameter to null, which is presently stored as 16 bits.  I
created an empty type; please see the small main procedure below. I have not
been able to have the size attribute work directly on null.

with Ada.Text_Io;
procedure Empty_Pkg is 
   package T_Io renames Ada.Text_Io;
   type Empty_Type is 
         (Empty); 
   for Empty_Type'Size use 0;
   Empty_Var : Empty_Type;  
begin
   T_Io.Put_Line("The size of empty is " & Integer'Image(Empty_Var'Size));

end Empty_Pkg;

This produced: The size of empty is 8

Thank you.
Bob Leif





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

end of thread, other threads:[~2004-07-06 22:28 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-02  8:30 Zero length Objects Christoph Karl Walter Grein
2004-07-06 11:59 ` Nick Roberts
2004-07-06 22:14   ` Randy Brukardt
2004-07-06 22:28     ` Nick Roberts
  -- strict thread matches above, loose matches on Subject: below --
2004-06-30  5:55 Robert C. Leif
2004-06-30 20:32 ` Jacob Sparre Andersen
2004-06-30 21:01 ` Frank J. Lhota
2004-07-01  0:02   ` Nick Roberts
2004-07-01  1:28     ` Georg Bauhaus
2004-07-01 10:37       ` Björn Persson
2004-07-01 11:25     ` Larry Kilgallen
2004-07-01 14:11       ` Nick Roberts
2004-07-01 15:42         ` Larry Kilgallen
2004-07-01 14:06     ` Xenos
2004-07-01 15:26       ` Nick Roberts
2004-07-02  1:06         ` Jeffrey Carter
2004-07-01  0:47   ` Brian May
2004-07-01 13:32     ` Frank J. Lhota
2004-07-01 14:52       ` Nick Roberts
2004-07-01 15:03         ` Xenos
2004-07-01 15:57           ` Hyman Rosen
2004-07-01 16:05             ` Xenos
2004-07-02 15:02               ` Frank J. Lhota
2004-07-02 15:11                 ` Adrian Knoth
2004-07-02 15:43                   ` Frank J. Lhota
2004-07-02 19:01                     ` Vinzent 'Gadget' Hoefler
2004-07-02 19:07                       ` Adrian Knoth
2004-07-02 19:25                         ` Vinzent 'Gadget' Hoefler
2004-07-02 21:06                           ` Xenos
2004-07-02 21:56                             ` Vinzent 'Gadget' Hoefler

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