I'm stuck please help 
Author Message
 I'm stuck please help

I'm a novice at Modula2, I'm just trying to get a better grade in a
University assignment.
I'm trying to include a date in the output file given by the program I'm
trying to write, but Topspeed Modula-2's help file isn't very helpful.
How do I get 4 variables: day, month, year and daytype containing the
date information and what type do I need to declare the variables as
being. The complier suggest DayType but I can't get this to work, or
find any help on this either.

Cheers

Dan Bishopp



Wed, 29 Aug 2001 03:00:00 GMT  
 I'm stuck please help

Quote:

>I'm a novice at Modula2, I'm just trying to get a better grade in a
>University assignment.
>I'm trying to include a date in the output file given by the program I'm
>trying to write, but Topspeed Modula-2's help file isn't very helpful.
>How do I get 4 variables: day, month, year and daytype containing the
>date information and what type do I need to declare the variables as
>being. The complier suggest DayType but I can't get this to work, or
>find any help on this either.

>Cheers

>Dan Bishopp

you will find the needed PROCEDURES and TYPES in the module Lib. Have a look
at the file Lib.def. the following example may help you :

PROCEDURE WrDateTime;

VAR year, month, day, hour, min, sec, hsec : CARDINAL;
          dayoftheweek : Lib.DayType;

BEGIN
  Lib.GetDate (year,month,day,dayoftheweek);
  Lib.GetTime (hour,min,sec,hsec);
  CASE dayoftheweek OF
  |  Lib.Sunday : IO.WrStr ('Sunday ')
  | Lib.Monday : IO.WrStr ('Monday')
(* and so on*)
  END;
  IO.WrCard (year,0);
  IO.WrStr('-');
  IO.WrCard(month,0);
  IO.WrStr ('-');
  IO.WrCard (day,0);
  IO.WrStr ('; ');
(* and so on *)
END WrDateTime;

MfG / Regards

        Peter Engels

Powered by OS/2 Warp 4 FP 9
This system has been running for 0d 0h 12m 38s 375ms (en).



Wed, 29 Aug 2001 03:00:00 GMT  
 I'm stuck please help
Thank you. Problem solved


Wed, 29 Aug 2001 03:00:00 GMT  
 I'm stuck please help


Quote:
>I'm a novice at Modula2, I'm just trying to get a better grade in a
>University assignment.
>I'm trying to include a date in the output file given by the program I'm
>trying to write, but Topspeed Modula-2's help file isn't very helpful.
>How do I get 4 variables: day, month, year and daytype containing the
>date information and what type do I need to declare the variables as
>being. The complier suggest DayType but I can't get this to work, or
>find any help on this either.

>Cheers

>Dan Bishopp

Modula 2 hasn't got efficient libraries to implement dates, hours ecc.
So you've to build them up !!

This is the definition module of the TimeDate library:

DEFINITION MODULE TimeDate;

TYPE
    Time =  RECORD
             day, minute, millisec :CARDINAL;
       (* day      = ((Year - 1900) * 16 + Month) * 32 + DayOfTheMonth
          minute   = minutes since midnight
          millisec = milliseconds past the minute  *)
            END;

PROCEDURE GetTime( VAR time :Time );
(*
    get the system time
*)

PROCEDURE SetTime( time :Time );
(*
    set the system time
*)

END TimeDate.

========================
So you have to import the Time type, the to use the GetTime functione
and then to convert the information stored in the variable of type
Time you declared in your function.

Is this useful ???
If you want some examples tell me.
I will help you without any problem.
Write me in e-mail if you want !

Bye.

Joyce
ICQ 10607234
Per una pera, una pera cazzo...
Per affrontare questa lunga giornata dura !



Fri, 31 Aug 2001 03:00:00 GMT  
 I'm stuck please help

Quote:

> Modula 2 hasn't got efficient libraries to implement dates, hours ecc.
> So you've to build them up !!

You might find our Calendar module helpful that may be freely distributed
under the terms of the LGPL:
   http://www.mathematik.uni-ulm.de/modula/man/man3/Calendar.html

Andreas.

--
Andreas Borchert, Universitaet Ulm, SAI, Helmholtzstr. 18, 89069 Ulm,  Germany

WWW:    http://www.mathematik.uni-ulm.de/sai/borchert/



Fri, 31 Aug 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Windows 32 application (please help, im stuck)

2. Please help me, im stuck

3. please help stuck with report date and time

4. I'm Stuck...can anyone help!

5. writing code - I'm stuck- anyone help?

6. please, please, please, please, help

7. will someone please, please, please, please HELP me?!!

8. LabView 5.1.1, 'Failure: "linker.c", line 1825': Please Help

9. From Hickory Sticks to Joy Sticks

10. Help please, 'shuffle' a list

11. Please help- Killing Python 'processes'

12. VSE 3.1 Repository Problem: Please help (please please?)

 

 
Powered by phpBB® Forum Software