* how to put Unsigned_64?
@ 2006-01-30 17:07 Norbert Caspari
2006-01-30 17:22 ` Frank J. Lhota
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Norbert Caspari @ 2006-01-30 17:07 UTC (permalink / raw)
If I try to printout a variable of the type Unsigned_64 with the put
statement (using Ada.Integer_IO), I get errors. Even though I use the item,
width and base arguments within the put statement.
Could somebody please give me an example that works?
The variable type Unsigned_64 is included in the Interface package.
I use the GNAT compiler.
Thanks a lot for your help!
Best regards, Norbert
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: how to put Unsigned_64?
2006-01-30 17:07 how to put Unsigned_64? Norbert Caspari
@ 2006-01-30 17:22 ` Frank J. Lhota
2006-01-30 18:18 ` Norbert Caspari
2006-01-30 17:24 ` Martin Dowie
2006-01-30 19:35 ` Keith Thompson
2 siblings, 1 reply; 6+ messages in thread
From: Frank J. Lhota @ 2006-01-30 17:22 UTC (permalink / raw)
You can create a package of subprograms for reading and writing
Unsigned_64 values by instantiating Ada.Text_Io.Modular_Io for the
Interface.Unsigned_64 type, e.g.
package Uns_64_Io is
new Ada.Text_Io.Modular_IO (Interface.Unsigned_64);
This package should meet your needs.
--
"All things extant in this world,
Gods of Heaven, gods of Earth,
Let everything be as it should be;
Thus shall it be!"
- Magical chant from "Magical Shopping Arcade Abenobashi"
"Drizzle, Drazzle, Drozzle, Drome,
Time for the this one to come home!"
- Mr. Lizard from "Tutor Turtle"
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: how to put Unsigned_64?
2006-01-30 17:22 ` Frank J. Lhota
@ 2006-01-30 18:18 ` Norbert Caspari
0 siblings, 0 replies; 6+ messages in thread
From: Norbert Caspari @ 2006-01-30 18:18 UTC (permalink / raw)
Frank J. Lhota wrote:
> You can create a package of subprograms for reading and writing
> Unsigned_64 values by instantiating Ada.Text_Io.Modular_Io for the
> Interface.Unsigned_64 type, e.g.
>
> package Uns_64_Io is
> new Ada.Text_Io.Modular_IO (Interface.Unsigned_64);
>
> This package should meet your needs.
>
That was what I'm looking for. Now it works.
Thanks a lot!
Best regards, Norbert
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: how to put Unsigned_64?
2006-01-30 17:07 how to put Unsigned_64? Norbert Caspari
2006-01-30 17:22 ` Frank J. Lhota
@ 2006-01-30 17:24 ` Martin Dowie
2006-01-30 18:23 ` Norbert Caspari
2006-01-30 19:35 ` Keith Thompson
2 siblings, 1 reply; 6+ messages in thread
From: Martin Dowie @ 2006-01-30 17:24 UTC (permalink / raw)
Norbert Caspari wrote:
> If I try to printout a variable of the type Unsigned_64 with the put
> statement (using Ada.Integer_IO), I get errors. Even though I use the item,
> width and base arguments within the put statement.
>
> Could somebody please give me an example that works?
>
> The variable type Unsigned_64 is included in the Interface package.
> I use the GNAT compiler.
First off, there is no such package as "Ada.Integer_IO", so I guess
you're actually using "Ada.Integer_Text_IO" :-)
"Ada.Integer_Text_IO" is an instance of "Ada.Text_IO.Integer_IO" for
type "Integer" - not for any other type. You need to instantiate a
version of "Ada.Text_IO.Modular_IO" with type "Interfaces.Unsigned_64".
Cheers
-- Martin
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: how to put Unsigned_64?
2006-01-30 17:24 ` Martin Dowie
@ 2006-01-30 18:23 ` Norbert Caspari
0 siblings, 0 replies; 6+ messages in thread
From: Norbert Caspari @ 2006-01-30 18:23 UTC (permalink / raw)
Martin Dowie wrote:
> First off, there is no such package as "Ada.Integer_IO", so I guess
> you're actually using "Ada.Integer_Text_IO" :-)
Yes, you're right, sorry ;-)
> "Ada.Integer_Text_IO" is an instance of "Ada.Text_IO.Integer_IO" for
> type "Integer" - not for any other type. You need to instantiate a
> version of "Ada.Text_IO.Modular_IO" with type "Interfaces.Unsigned_64".
Thanks a lot for this hint. I got also another reply, describing actually
the same. Now it works.
Best regards, Norbert
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: how to put Unsigned_64?
2006-01-30 17:07 how to put Unsigned_64? Norbert Caspari
2006-01-30 17:22 ` Frank J. Lhota
2006-01-30 17:24 ` Martin Dowie
@ 2006-01-30 19:35 ` Keith Thompson
2 siblings, 0 replies; 6+ messages in thread
From: Keith Thompson @ 2006-01-30 19:35 UTC (permalink / raw)
Norbert Caspari <nnc@gmx.li> writes:
> If I try to printout a variable of the type Unsigned_64 with the put
> statement (using Ada.Integer_IO), I get errors. Even though I use the item,
> width and base arguments within the put statement.
>
> Could somebody please give me an example that works?
>
> The variable type Unsigned_64 is included in the Interface package.
> I use the GNAT compiler.
For future reference, if you have a problem like this you need to
provide more information. Show us the code that's failing (don't
re-type it, copy-and-paste the *exact* code). Don't tell us "I get
errors", *show us* the actual error messages.
This question happened to be an easy one, but your next one may not
be, and you'll save us all a lot of time if we don't have to ask for
more information.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-01-30 19:35 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-30 17:07 how to put Unsigned_64? Norbert Caspari
2006-01-30 17:22 ` Frank J. Lhota
2006-01-30 18:18 ` Norbert Caspari
2006-01-30 17:24 ` Martin Dowie
2006-01-30 18:23 ` Norbert Caspari
2006-01-30 19:35 ` Keith Thompson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox