text
stringlengths
0
234
Put ("Copyright Louis-A. de Fouquieres, Miletus, 2015-2019, calendriermilesien.org");
New_Line;
loop
begin -- a block with exception handler
Put (Prompter); New_Line;
Get (Command);
case Command is
when 'X' => Put ("Bye !");
when 'H' => Skip_Line; raise Help_request;
when 'V' => Verbose := True; Put ("Verbose mode on");
when 'S' => Verbose := False; Put ("Verbose mode off");
when 'G' | 'J' =>
Get (Level);
Put("Calendar: "); Put (Command);
Put (", final year: "); Put (Level, 7);
case Command is
when 'G' =>
For Year in 0 .. Level loop
D1 := Butcher (Year); D2 := Easter_days (Year, Gregorian);
if Verbose or D1 /= D2 then
New_Line; Put ("Year: "); Put (Year);
Put (", Butcher: "); Put (D1,2);
Put (", Milesian: "); Put (D2,2);
end if;
end loop;
when 'J' =>
For Year in 0 .. Level loop
D1 := Delambre (Year); D2 := Easter_days (Year, Julian);
if Verbose or D1 /= D2 then
New_Line; Put ("Year: "); Put (Year);
Put (", Delambre: "); Put (D1,2);
Put (", Milesian: "); Put (D2,2);
end if;
end loop;
when others => raise Command_error;
end case;
New_Line; Put ("== End comparison ==");
when others => raise Command_error;
end case;
exception
when Help_request => Put (Help_text);
when Command_error => Put (" Invalid command !"); Skip_Line;
when others => Put (" Unknown error !"); Skip_Line;
Function Definition: procedure Milesian_converter is
Function Body: NL : constant String := CR & LF ;
Licence_text : constant String :=
"Date converter and moon phase computer using the Milesian calendar." & NL &
"Written by Louis A. de Fouquieres, Miletus," & NL &
"Initial version M2015-09-30, actual version M2019-01-16." & NL &
"Generated with the GNAT Programming Studio GPL Edition 2014." & NL &
"No warranty of any kind arising from or in connection with this application."
& NL & "Library sources available on demand under GP licence."
& NL & "No commercial usage allowed - inquiries: www.calendriermilesien.org";
Prompter : constant String := "Type command and figures, or H for Help:";
Help_text : constant String :=
"This line mode program converts dates from and to "
& NL &
"Julian day, Milesian, Gregorian, and Julian calendars." & NL &
"Mean Moon age, residue and lunar time are also computed, " & NL &
"as well as yearly key figures."
& NL &
"Syntax: <Command> <1 to 6 numbers separated with spaces>." & NL &
"<Command> is one character as described hereunder." & NL &
"Numbers are decimal possibly beginning with + or -, without spaces," & NL &
"with a dot (.) as decimal separator when applicable." & NL &
"When a date is expected, it must be entered as: year (-4800 to 9999),"
& NL &
"month number (1 to 12, by default: 1), day number (1 to 31, by default: 1),"
& NL &
"hours (0 to 23, default 12), minutes and seconds (default 0, max 59)."
& NL & "Time of day is Terrestrial Time (64,184 s ahead of UTC in 2000)."
& NL &
"Lunar time is time of day where the mean Moon stands" & NL &
"at the same azimuth than the mean Sun at this solar time." & NL &
"Yearly key figures ('Y' command) include" & NL &
"- doomsday, i.e. day of the week that falls at same dates every year," & NL &
"- lunar figures at new year's eve at 7h30 UTC," & NL &
"- Milesian epact and yearly lunar residue, in half-integer," & NL &
"- spring full moon residue in integer value," & NL &
"- for years A.D., days between 21st March and Easter"
& NL &
"following the Gregorian and Julian Catholic ecclesiastical computus," & NL &
"and finally the delay, in days, of dates in Julian compared to Gregorian."
& NL &
"Available commands:" & NL &
"D <Positive integer or decimal number>: Julian day;" & NL &
"G <Date>: Date in Gregorian calendar (even before 1582);" & NL &
"J <Date>: Date in Julian calendar;" & NL &
"M <Date>: Date in Milesian calendar;" & NL &
"Y <Year>: Yearly key figures (see above);"
& NL &
"A <Days> [<Hours> [<Minutes> [<Seconds>]]]: Add days, hours, mins, secs"
& NL & "to current date, each figure is a signed integer, 0 by default;"
& NL &
"H: display this text;" & NL &