comp.lang.ada
 help / color / mirror / Atom feed
* HELP NEEDED !! URGENT !!
@ 1999-02-22  0:00 Pierre
  1999-02-22  0:00 ` dennison
  1999-02-22  0:00 ` John Herro
  0 siblings, 2 replies; 3+ messages in thread
From: Pierre @ 1999-02-22  0:00 UTC (permalink / raw)


Could someone tell me how i can make to do input/output on an object of type
TIME of the package Ada.Calandar_IO ??
thank you very much if you can help me :-)






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

* Re: HELP NEEDED !! URGENT !!
  1999-02-22  0:00 HELP NEEDED !! URGENT !! Pierre
@ 1999-02-22  0:00 ` dennison
  1999-02-22  0:00 ` John Herro
  1 sibling, 0 replies; 3+ messages in thread
From: dennison @ 1999-02-22  0:00 UTC (permalink / raw)


In article <7arl83$qac$1@wolfenstein.adesium-services.fr>,
  "Pierre" <pierre.blanchou@aliso.com> wrote:
> Could someone tell me how i can make to do input/output on an object of type
> TIME of the package Ada.Calandar_IO ??

In human-readable form, or just saving as data?

Streams or Sequential_IO are the standard ways to do data I/O. If you want
translate TIME into human-readable form, you'll probably need to use
Calendar.Split and display all the resultant parts in human-readable form.



T.E.D.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




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

* Re: HELP NEEDED !! URGENT !!
  1999-02-22  0:00 HELP NEEDED !! URGENT !! Pierre
  1999-02-22  0:00 ` dennison
@ 1999-02-22  0:00 ` John Herro
  1 sibling, 0 replies; 3+ messages in thread
From: John Herro @ 1999-02-22  0:00 UTC (permalink / raw)



<pierre.blanchou@aliso.com> writes:
> Could someone tell me how I can ... do input/output
> on an object of type TIME of the package Ada.Calendar_IO ?

Since type Time is private and the package Ada.Calendar_IO provides no
input/output functions, you can't directly input or output objects of type
Time.  However, you can use procedure Split to convert an object of type Time
to into Year (type Integer), Month (type Integer), Day (type Integer), and
Seconds (type Duration, a fixed-point type).  You can then output these types. 
For example, if Y is the Year, you can write
Ada.Text_IO.Put(Integer'Image(Y));.

For input, you can input the Year, Month, Day, and Seconds, and then use
function Time_Of to convert to an object of type Time.  The easiest way to
input the Year, for example, is to use Get_Line and then convert the String to
the Year.  For example,
S   : String(1 .. 80);
Len : Natural;
Y   : Ada.Calendar.Year_Number;
...
Ada.Text_IO.Get_Line(Item => S, Last => Len);
Y := Integer'Value(S(1 .. Len));

I hope this helps.

- John Herro
You can download a shareware AdaTutor program at
http://members.aol.com/AdaTutor




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

end of thread, other threads:[~1999-02-22  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-02-22  0:00 HELP NEEDED !! URGENT !! Pierre
1999-02-22  0:00 ` dennison
1999-02-22  0:00 ` John Herro

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