comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <bauhaus@futureapps.de>
Subject: Re: how to "put" a binary structure? (newbie question!)
Date: Wed, 01 Feb 2006 19:34:57 +0100
Date: 2006-02-01T19:34:45+01:00	[thread overview]
Message-ID: <43e0ff45$0$4087$9b4e6d93@newsread2.arcor-online.net> (raw)
In-Reply-To: <drqpnb$43l$00$1@news.t-online.com>

Norbert Caspari wrote:

> 
> How can I correct the source code to print the values stored in the 
> structure Xxx? Is it possible, to print the whole content of Xxx with just 
> one put statement? Or alternatively how can I assign the content of Xxx to 
> another variable of the type Unsigned_8 that I can use for output? Or is 
> there maybe another way?

In addition to Dmitry's suggestions, consider initialising an
entire aggregate (record, or array). This way the compiler can
check complete initialisation

You can use the predefined 'Image attribute function of Bit_T for
printing, as shown below.

   Xxx: Byte :=
     (Bit0 => off,
      Bit1 => on,
      Bit2 => off,
      Bit3 => off,
      Bit4 => on,
      Bit5 => on,
      Bit6 => off,
      Bit7 => off);

begin
   Text_IO.put_line("Bit 1 is " & Bit_T'image(Xxx.Bit1));
   -- etc.
end bittest;

-- Georg 



  parent reply	other threads:[~2006-02-01 18:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-01 17:04 how to "put" a binary structure? (newbie question!) Norbert Caspari
2006-02-01 18:23 ` Dmitry A. Kazakov
2006-02-01 18:34 ` Georg Bauhaus [this message]
2006-02-01 18:59 ` Martin Krischik
2006-02-02 11:06   ` Stephen Leake
2006-02-02  2:10 ` Jeffrey R. Carter
replies disabled

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