PROGRAM d1r2(input,output,dfile);
(* driver for JULDAY *)
LABEL 99;
TYPE
   month = string[10];
VAR
   i,id,im,iy,n : integer;
   txt : string[40];
   name : ARRAY [1..12] OF month;
   dfile : text;

(*$I MODFILE.PAS *)
{$I funcs.pas}
(*$I JULDAY.PAS *)

BEGIN
   name[1] := 'january   '; name[2] := 'february  ';
   name[3] := 'march     '; name[4] := 'april     ';
   name[5] := 'may       '; name[6] := 'june      ';
   name[7] := 'july      '; name[8] := 'august    ';
   name[9] := 'september '; name[10] := 'october   ';
   name[11] := 'november  '; name[12] := 'december  ';
   glopen(dfile,'dates1.dat');
   readln(dfile,txt);
   readln(dfile,n);
   writeln;
   writeln('month':5,'day':8,'year':6,'julian day':12,'event':9);
   writeln;
   FOR i := 1 to n DO BEGIN
      readln(dfile,im,id,iy,txt);
      writeln(name[im]:10,id:3,iy:6,' ',julday(im,id,iy):10:0,' ':5,txt);
   END;
   close(dfile);
   writeln;
   writeln('your choices:');
   writeln('month day year (e.g. 1 13 1905)');
   FOR i := 1 to 20 DO BEGIN
      writeln;
      writeln('mm dd yyyy ?');
      readln(im,id,iy);
      IF (im < 0) THEN GOTO 99;
      writeln('julian day: ',julday(im,id,iy):10:0)
   END;
99:
END.
