From: Marin David Condic <condicma@bogon.pwfl.com>
To: Emmanuel Lambert <Emmanuel.Lambert@cs.kuleuven.ac.be>
Subject: Re: Putting a 'Duration' on the screen ?
Date: 1999/01/18
Date: 1999-01-18T00:00:00+00:00 [thread overview]
Message-ID: <36A38F05.EA6F4DD1@pwfl.com> (raw)
In-Reply-To: 36A37529.69BFB3FF@cs.kuleuven.ac.be
Ada.Float_Text_IO doesn't work because Duration is not a floating point
type. It is a fixed point type. You've got two choices here:
with Ada.Text_IO.Fixed_IO ;
procedure Blah_Blah_Blah is
package
My_Fixed_IO
is new
Ada.Text_IO.Fixed_IO (
Num => Duration) ;
-- After this, you have a procedure My_Fixed_IO.Put you can call...
...
...
...
*OR*
Ada.Text_IO.Put_Line ("Current Duration: " & Duration'Image (X)) ;
where X above is declared to be of type Duration. The numeric types have
the 'Image attribute which will return a string. See the ARM 3.5 (35)
for a definition.
Hope this helps.
MDC
Emmanuel Lambert wrote:
>
> Hi,
>
> I am freaking out because I would like to output a variable from type
> Duration to the screen, but it does not work with put(...). I have
> included Ada.Float_Text_Io, but that does not help. Can someone give me
> a hint. I a unable to find good documentation on this.
>
> Thanks
> Emmanuel Lambert
--
Marin David Condic
Real Time & Embedded Systems, Propulsion Systems Analysis
United Technologies, Pratt & Whitney, Large Military Engines
M/S 731-95, P.O.B. 109600, West Palm Beach, FL, 33410-9600
Ph: 561.796.8997 Fx: 561.796.4669
***To reply, remove "bogon" from the domain name.***
"Nobody shot me."
-- Last words of Frank Gusenberg when asked by police who
shot him fourteen times with a machine gun in the Saint
Valentine's Day Massacre.
next prev parent reply other threads:[~1999-01-18 0:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-01-18 0:00 Putting a 'Duration' on the screen ? Emmanuel Lambert
1999-01-18 0:00 ` Marin David Condic [this message]
1999-01-18 0:00 ` David C. Hoos, Sr.
1999-01-18 0:00 ` Marin David Condic
1999-01-18 0:00 ` Emmanuel Lambert
1999-01-18 0:00 ` robert_dewar
1999-01-18 0:00 ` Steve O'Neill
1999-01-19 0:00 ` Matthew Heaney
1999-01-18 0:00 ` Tom Moran
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox