comp.lang.ada
 help / color / mirror / Atom feed
* Implementation Problems w/ the Package Calendar
@ 1991-11-13 13:33 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!malgudi.oar.net!zeus.frankli
  0 siblings, 0 replies; 2+ messages in thread
From: cis.ohio-state.edu!zaphod.mps.ohio-state.edu!malgudi.oar.net!zeus.frankli @ 1991-11-13 13:33 UTC (permalink / raw)


am aenior working for my BSCS and am trying to teach myself the language
Ada. I am having difficulty w/ the data types used in the Package
Calendar. I am using a the following syntax: 

  t : time := clock;
  d : duration;
  begin --main program 
     t := clock;
     -- main function
     d := (t-clock);
  end prog;

I am trying to find the growth rate of several algorithms using big O
notation. My problem lies in trying to display the value held in d ( the
duration variable ). I cannot find a package (text_io, basic_num_io,
etc..) that will allow me to display (put) the variable d. 

Can anyone tell me how (or what package to use) to display a variable
with the data type of duration. Please send me a message directly (I am
not very expirienced w/ using the Internet). I can be reached at 
hart@franklin.edu . 

Your help is greatly appriciated,

Drew R. Hart I

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

* Re: Implementation Problems w/ the Package Calendar
@ 1991-11-13 16:12 Arthur Evans
  0 siblings, 0 replies; 2+ messages in thread
From: Arthur Evans @ 1991-11-13 16:12 UTC (permalink / raw)


hart@zeus.franklin.edu (Drew Hart) asks how to output a value of type
Duration.

Duration is a fixed point type declared in package Standard (LRM C(19)).
If you look up Duration in the LRM's index, you will find references to
section 9.6 (in which package Calendar is introduced) and to Appendix C;
the latter contains its declaration.

To output values of this type, you must instantiate Text_IO.Fixed_IO.
That package's spec is in 14.3.10 and it is explained in 14.3.8.  Write

    package Duration_IO is new Text_IO.Fixed_IO(Num => Duration);

and you then have access to the subprograms described in 14.3.8

Good luck!

Art Evans
----------------------------------------
Arthur Evans, Jr, PhD		Ada Consultant
461 Fairview Road
Pittsburgh PA  15238-1933
412-963-0839
ae@sei.cmu.edu

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

end of thread, other threads:[~1991-11-13 16:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1991-11-13 16:12 Implementation Problems w/ the Package Calendar Arthur Evans
  -- strict thread matches above, loose matches on Subject: below --
1991-11-13 13:33 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!malgudi.oar.net!zeus.frankli

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