home *** CD-ROM | disk | FTP | other *** search
-
- MODULE DateDemo;
- (*---------------------------------------------------------------------*)
- (* D A T E - C A L C - D E M O *)
- (* M 2 P R O L I B *)
- (* Copyright (C) 1987 Bühlmann Computer Software CH-8636 WALD *)
- (* -- All Rights Reserved -- *)
- (*---------------------------------------------------------------------*)
- (* Author: X. Bühlmann *)
- (* *)
- (* Version 1.0 Date: 28/09/88 *)
- (*---------------------------------------------------------------------*)
- FROM DateCalc IMPORT sDateFormat, eDateFormat, aDateType, DateFormat,
- DateControl, DaysToDate, CountDate, CardDate;
- IMPORT Screen, ScreenNum;
- IMPORT Terminal;
- VAR
- g :
- RECORD
- Day : LONGINT;
- Date : aDateType;
- dType : ARRAY [0..1] OF CHAR;
- END;
- PROCEDURE Copyright();
- BEGIN
- Screen.ClearScrBound();
- Screen.ScrWriteLn();
- Screen.ScrPutString(
- ' D A T E - D E M O Version 1.0 ');
- Screen.ScrWriteLn();
- Screen.ScrPutString(
- ' 1 9 8 8 ');
- Screen.ScrWriteLn();
- Screen.ScrWriteLn();
- Screen.ScrPutString(
- ' Copyright by ');
- Screen.ScrWriteLn();
- Screen.ScrPutString(
- ' (c) Bühlmann Computer Software ');
- Screen.ScrWriteLn();
- Screen.ScrPutString(
- ' CH-8636 Wald ');
- Screen.ScrWriteLn();
- END Copyright;
- BEGIN
- Copyright();
- LOOP
- Screen.ScrPutString('Keine Eingabe = Ende');
- Screen.ScrWriteLn();
- Screen.ScrPutString(
- 'USA = U / Europe = E / Japan = J / Long = L / Short = S');
- Screen.ScrWriteLn();
- Screen.ScrPutString('Format [UL/EL/JL/US/ES/JS]: ');
- g.dType := '';
- Terminal.ReadString(g.dType);
- g.dType[0] := CAP(g.dType[0]);
- g.dType[1] := CAP(g.dType[1]);
- CASE g.dType[0] OF
- | 'U' :
- CASE g.dType[1] OF
- | 'L' :
- DateFormat := sDateFormat{usa,long};
- ELSE
- DateFormat := sDateFormat{usa,short};
- END;
- | 'J' :
- CASE g.dType[1] OF
- | 'L' :
- DateFormat := sDateFormat{japan,long};
- ELSE
- DateFormat := sDateFormat{japan,short};
- END;
- | 'E' :
- CASE g.dType[1] OF
- | 'L' :
- DateFormat := sDateFormat{europe,long};
- ELSE
- DateFormat := sDateFormat{europe,short};
- END;
- ELSE
- EXIT;
- END;
- LOOP
- Screen.ScrWriteLn();
- DaysToDate(LONGINT(0), g.Date);
- Screen.ScrPutString('Von ');
- Screen.ScrPutString(g.Date);
- Screen.ScrPutString(' bis ');
- Terminal.ReadString(g.Date);
- IF g.Date[0]=0C THEN
- EXIT;
- END;
- IF CountDate(g.Date,g.Day) THEN
- Screen.ScrPutString(g.Date);
- Screen.ScrWriteLn();
- Screen.ScrPutString('Julianisches Datum = ');
- ScreenNum.WriteLong(g.Day, 10);
- Screen.ScrPutString(' Gregorianisches Datum = ');
- DaysToDate(g.Day, g.Date);
- Screen.ScrPutString(g.Date);
- ELSE
- Screen.ScrPutString(' Falsches Datum ');
- END;
- Screen.ScrWriteLn();
- END;
- END;
- END DateDemo.