comp.lang.ada
 help / color / mirror / Atom feed
From: Erik Sigra <sigra@home.se>
Subject: Re: Read booleans from streams
Date: Mon, 25 Mar 2002 11:46:53 +0100
Date: 2002-03-25T11:46:53+01:00	[thread overview]
Message-ID: <mailman.1017052982.30352.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: <3C9E85F6.8EDF3AAD@myob.com>

Thanks for your reply!

m�ndagen den 25 mars 2002 03.05 skrev du:
> >raised ADA.IO_EXCEPTIONS.END_ERROR : s-stratt.adb:170
>
> Your loop doesn't do an EOF test.

That was expected. It was the reading I wanted to investigate, so I didn't 
bother with an EOF test.


> >data
> >====
> >02027203
>
> Which looks like
>
> 0000_0000,0000_0010,0000_0000,0000_0010,
>         ^         ^         ^         ^
>         0         0         0         0
>
> 0000_0111,0000_0010,0000_0000,0000_0011
>         ^         ^         ^         ^
>         1         0         0         1
>
>
> And your results look like
>
> 0 0 0 0 1 0 0 1
>
> Interesting, I havn't checked it but how about
> changing

Actually it were the characters '0', '2' and '7' that were stored in the 
file, so it was rather

0001_1000,0001_1010,0001_1000,0001_1010,
        ^         ^         ^         ^
        0         0         0         0
0001_1111,0001_1010,0001_1000,0001_1011
        ^         ^         ^         ^
        1         0         0         1

but that's essentially the same in this matter.


>
> "for Boolean_Aggregate'Component_Size use 1;"
>
> to
>
> "pragma Pack (Boolean_Aggregate);" and if
> that doesn't work, try

I already tried that.


>
> "for Boolean_Aggregate'Component_Size use 1;"
> "for Boolean_Aggregate'Size use 8";

And I tried that too. I even used the test

   Put_Line ("Boolean_Aggregate'Size = " & Boolean_Aggregate'Size'Img);

in the program and it showed "Boolean_Aggregate'Size =  8". I use gnat-3.13p. 
Any other suggestions?



  parent reply	other threads:[~2002-03-25 10:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200203242318.g2ONIkc12876@a77.ib.student.liu.se>
2002-03-25  2:05 ` Read booleans from streams sk
     [not found] ` <3C9E85F6.8EDF3AAD@myob.com>
2002-03-25 10:46   ` Erik Sigra [this message]
2002-03-24 23:18 Erik Sigra
2002-03-25  3:57 ` Eric G. Miller
2002-03-25 11:21   ` Erik Sigra
     [not found]   ` <200203251121.g2PBL9401018@a77.ib.student.liu.se>
2002-03-25 16:00     ` sk
replies disabled

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