comp.lang.ada
 help / color / mirror / Atom feed
From: Matthew Heaney <matthew_heaney@acm.org>
Subject: Re: Putting a 'Duration' on the screen ?
Date: 1999/01/19
Date: 1999-01-19T00:00:00+00:00	[thread overview]
Message-ID: <m3iue3agbv.fsf@mheaney.ni.net> (raw)
In-Reply-To: 36A37C1F.2A4C3188@top.monad.net

Steve O'Neill <oneills@top.monad.net> writes:

> Emmanuel Lambert wrote:
> 
> > 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.
> 
> The hint is - Duration is not a floating point type, it's a fixed point
> type.  Either instantiate Fixed_IO for Duration or convert the duration
> object to float.

No, do not convert Duration to float.

You can either:

1) Use an instantiation of Ada.Text_IO.Fixed_IO; or

2) Use the attribute Duration'Image (X).

The 2nd option is easier.


-- 
Those who believe in the supernatural should be required to learn
computer programming.  This would force them to discover that things
which appear at first to be completely mysterious and incomprehensible,
in fact have a logical (and usually simple) explanation.  --J.B.R. Yant




      reply	other threads:[~1999-01-19  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
1999-01-18  0:00   ` David C. Hoos, Sr.
1999-01-18  0:00     ` Marin David Condic
1999-01-18  0:00 ` robert_dewar
1999-01-18  0:00 ` Emmanuel Lambert
1999-01-18  0:00 ` Tom Moran
1999-01-18  0:00 ` Steve O'Neill
1999-01-19  0:00   ` Matthew Heaney [this message]
replies disabled

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