comp.lang.ada
 help / color / mirror / Atom feed
From: "Norman H. Cohen" <ncohen@watson.ibm.com>
Subject: Re: Leading zeros with Int_IO.Put()?  Or another package?
Date: 1996/11/08
Date: 1996-11-08T00:00:00+00:00	[thread overview]
Message-ID: <3283520E.1939@watson.ibm.com> (raw)
In-Reply-To: EACHUS.96Nov6183636@spectre.mitre.org


Robert I. Eachus wrote:


> ... 2) In Ada 95 look at Annex F.  

Good idea, this is certainly an appropriate application of
picture-directed output.  If your compiler supports the Information
Systems annex, you can write:

   with Ada.Text_IO.Editing; 
   use Ada.Text_IO, Ada.Text_IO.Editing;

   procedure Put_Time (Hours, Minutes, Seconds: in Integer) is
      type Time_Component_Type is
         delta 1.0 digits 2 range 0.0 .. 60.0;
      package Time_Component_Output is
         new Decimal_Output (Time_Component_Type);
      use Time_Component_Output;
      Leading_Zero  : constant Picture := To_Picture ("99");
      Leading_Space : constant Picture := To_Picture ("Z9");
   begin
      Put (Time_Component_Type(Hours), Leading_Space);
      Put (':');
      Put (Time_Component_Type(Minutes), Leading_Zero);
      Put (':');
      Put (Time_Component_Type(Seconds), Leading_Zero);
   end Put_Time;

-- 
Norman H. Cohen
mailto:ncohen@watson.ibm.com
http://www.research.ibm.com/people/n/ncohen




  reply	other threads:[~1996-11-08  0:00 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-11-05  0:00 Leading zeros with Int_IO.Put()? Or another package? J.D. Baldwin
1996-11-05  0:00 ` Samuel Tardieu
1996-11-05  0:00 ` David Shochat
1996-11-08  0:00   ` robin
1996-11-08  0:00     ` Robert Dewar
1996-11-10  0:00       ` Verne Arase
1996-11-13  0:00       ` robin
1996-11-13  0:00         ` Ken Garlington
1996-11-19  0:00           ` robin
1996-11-19  0:00             ` Robert Dewar
1996-11-20  0:00             ` Richard A. O'Keefe
1996-11-20  0:00               ` Robert Dewar
1996-11-20  0:00               ` robin
1996-11-20  0:00                 ` Larry J. Elmore
1996-11-25  0:00                   ` robin
1996-11-25  0:00                     ` Robert Dewar
1996-11-26  0:00                     ` Larry J. Elmore
1996-11-20  0:00                 ` Richard A. O'Keefe
1996-11-22  0:00                   ` robin
1996-11-22  0:00                     ` Richard A. O'Keefe
1996-11-23  0:00                       ` robin
1996-11-20  0:00                 ` Robert Dewar
1996-11-22  0:00                   ` Richard A. O'Keefe
1996-11-25  0:00                   ` shmuel
1996-11-21  0:00                 ` Jerry Coffin
1996-11-22  0:00                 ` Ken Garlington
1996-11-20  0:00             ` Norman H. Cohen
1996-11-22  0:00             ` Ken Garlington
1996-11-27  0:00               ` Verne Arase
1996-12-02  0:00                 ` Ken Garlington
     [not found]             ` <56tjrh$4a <MPLANET.3294c204jcoffin989a3e@news.rmi.net>
1996-11-24  0:00               ` Bert
1996-11-13  0:00       ` robin
1996-11-13  0:00         ` Ken Garlington
1996-11-19  0:00           ` robin
1996-11-22  0:00             ` Ken Garlington
1996-11-22  0:00             ` Robert Dewar
1996-11-17  0:00         ` Robert Dewar
1996-11-08  0:00     ` Ken Garlington
1996-11-21  0:00   ` Robert I. Eachus
1996-11-22  0:00     ` robin
1996-11-06  0:00 ` Norman H. Cohen
1996-11-07  0:00   ` Pascal Obry
1996-11-07  0:00     ` Norman H. Cohen
1996-11-08  0:00   ` Norman H. Cohen
1996-11-09  0:00     ` Robert Dewar
1996-11-06  0:00 ` Stephen Leake
1996-11-06  0:00 ` Robert I. Eachus
1996-11-08  0:00   ` Norman H. Cohen [this message]
1996-11-08  0:00 ` David Emery
1996-11-24  0:00 ` Fergus Henderson
1996-11-24  0:00   ` Robert Dewar
1996-11-25  0:00     ` J. David Bryan
1996-11-25  0:00     ` Larry Kilgallen
1996-11-27  0:00     ` Verne Arase
1996-11-28  0:00   ` Richard A. O'Keefe
  -- strict thread matches above, loose matches on Subject: below --
1996-11-05  0:00 Collection of 2500+ links about Object-Orientation - interested ? Manfred Schneider
1996-11-07  0:00 ` Leading zeros with Int_IO.Put()? Or another package? John Herro
1996-11-07  0:00   ` James Rogers
1996-11-07  0:00   ` Robert Dewar
1996-12-15  0:00 Robert Dewar
replies disabled

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