comp.lang.ada
 help / color / mirror / Atom feed
* Leading zeros with Int_IO.Put()?  Or another package?
@ 1996-11-05  0:00 J.D. Baldwin
  1996-11-05  0:00 ` Samuel Tardieu
                   ` (6 more replies)
  0 siblings, 7 replies; 59+ messages in thread
From: J.D. Baldwin @ 1996-11-05  0:00 UTC (permalink / raw)




A "how-to" question from an Ada dabbler:

I just got a copy of GNAT and 'make'-ed the examples.  The first one
I ran, cal.exe, gave me the following date and time:

                11/5/1996 10:4:3

. . . when what one *wants* of course is:

                11/05/1996 11:04:03

(Leading zero optional--but, by me, preferred--for the date; omitting
it is of course inexcusable for the minutes and seconds fields in the
time.)

In C, building a formatted string takes care of such silliness.
(Spare me a list of C's other, more-than-offsetting, shortcomings,
please.)  I seem to recall from the mists of the distant past that
Pascal provided a means of accomplishing this, too.

I searched the c.l.a archives at DejaNews, I web-searched for Int_IO,
I scanned the FAQ and I read the appropriate sections of RM95 (A.10.8
and adjacent). I found nothing about leading zeros except as pertains
to exponent portions of floating point numbers.  (Actually, I found
one snippet of example code that implemented the same kludge I did.)

So I added relevant lines of code to CAL.ADB:

                  if (MINUTE <= 9) then
                     Int_IO.Put(0, 0);
                  end if;
                  Int_IO.Put(MINUTE,0);

. . . and so forth, for each relevant value.

My question:  is there a better way to pad out integers with leading
zeros?  What if I wanted to pad to a width of three or four or sixteen,
all with zeros?  Is there a standard way to achieve this in Ada?
--
 From the catapult of J.D. Baldwin  |+| "If anyone disagrees with anything I
   _,_    Finger baldwin@netcom.com |+| say, I am quite prepared not only to
 _|70|___:::)=}-  for PGP public    |+| retract it, but also to deny under
 \      /         key information.  |+| oath that I ever said it." --T. Lehrer
***~~~~-----------------------------------------------------------------------




^ permalink raw reply	[flat|nested] 59+ messages in thread
* Collection of 2500+ links about Object-Orientation - interested ?
@ 1996-11-05  0:00 Manfred Schneider
  1996-11-07  0:00 ` Leading zeros with Int_IO.Put()? Or another package? John Herro
  0 siblings, 1 reply; 59+ messages in thread
From: Manfred Schneider @ 1996-11-05  0:00 UTC (permalink / raw)



Hello,

are you interested in a collection of more than 2500 links
about object-orientation? No ads, fast and free access!

Main topics of the collection are:

   o   General Information and Links
   o   Distributed Objects, Corba, OpenDoc, ActiveX / OLE,
       Object Request Brokers, Business Objects
   o   OOA/OOD Methods and Tools, Diagram Layout
   o   Languages, Ada, Delphi, Eiffel, Java, JavaScript, 
       Python, Smalltalk, VBScript, Visual Basic, Visual C++
   o   Databases, OO DBMS, OR DBMS
   o   Patterns, Libraries, Frameworks
   o   Metrics, Reuse, Testing, Numerics
   o   Services and Companies

The collection runs on a server in Heidelberg, Germany.
Mirrors are available for faster access from other contries.

URL of original site:

   o   http://www.rhein-neckar.de/~cetus/software.html

URLs of mirrors:

   o   Australia, Melbourne
       http://www.csse.swin.edu.au/manfred/software.html

   o   Brazil, RS, Porto Alegre
       http://www.intuitive.com.br/cetus/software.html

   o   USA, IL, Chicago
       http://www.objenv.com/cetus/software.html

   o   USA, UT, Provo
       http://mini.net/cetus/software.html

I am still looking for sites in ASIA, which would like to mirror 
Cetus. So visitors from the APA region have easier access 
to the link collection.

Moreover I am interested in further URLs about ... 
   o   diagram layout
   o   frameworks
   o   metrics
   o   reuse
   o   testing

If you are interested in mirroring or know some URLs 
please let me know.

Manfred





^ permalink raw reply	[flat|nested] 59+ messages in thread
* Re: Leading zeros with Int_IO.Put()? Or another package?
@ 1996-12-15  0:00 Robert Dewar
  0 siblings, 0 replies; 59+ messages in thread
From: Robert Dewar @ 1996-12-15  0:00 UTC (permalink / raw)



"Yes, we do.
We also have code still running unchanged which can be traced back to the
70s; how about you?"

Well of course the answer is yes (my Xray crystallography codes developed
in the late 60's are still in use, and SPITBOL/370, originally developed
in the early 70's is still in wide use -- there are even some United Airlines
counters still using old Incoterm machines for which I wrote the software
around 1970 -- it's quite amazing how old code sticks around :-)

But I do not punch my code on 80-column cards any more. In fact last I knew
you cannot buy 80-column cards any more -- I know this because there was a
major panic at NYU some years ago. They used 80-column cards for
registration, and the last company announced they were being discontinued.
NYU bought up the remaining stock and managed to keep going for another
couple of years (using ancient unit record equipment :-)






^ permalink raw reply	[flat|nested] 59+ messages in thread

end of thread, other threads:[~1996-12-15  0:00 UTC | newest]

Thread overview: 59+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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     ` Ken Garlington
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               ` 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               ` Robert Dewar
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-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
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   ` Robert Dewar
1996-11-07  0:00   ` James Rogers
1996-12-15  0:00 Robert Dewar

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