Talk:Day of the week: Difference between revisions

→‎Ada program: ada hard time
(→‎Ada program: ada hard time)
Line 63:
 
Thanks for your time, I will check all the env. --[[User:ShinTakezou|ShinTakezou]] 19:26, 12 December 2008 (UTC)
 
===Ada hard time...===
I did all the kind of tests I could do. At the end, taken a look at the *.ads file (ugly naming conventions!), and at the end I successfulling compiled the following code:
 
<ada>with GNAT.Calendar; use GNAT.Calendar;
with GNAT.Calendar.Time_IO; use GNAT.Calendar.Time_IO;
with Ada.Text_IO; use Ada.Text_IO;
procedure Yuletide is
begin
for Year in 2008..2121 loop
if Day_Of_Week (Time_Of (Year, 12, 25, 0, 0, 0)) = Sunday then
Put_Line (Image (Time_Of (Year, 12, 25, 0,0,0), ISO_Date));
end if;
end loop;
end Yuletide;</ada>
 
Which by the way on my machine outputs (only last lines)
 
<pre>2089-12-25
2095-12-25
 
raised CONSTRAINT_ERROR : yuletide.adb:8 range check failed</pre>
 
Anyway, at least I ''discovered'' how to ''arrange'' the code on my system with my poor GNAT :) --[[User:ShinTakezou|ShinTakezou]] 20:52, 12 December 2008 (UTC)
 
==When failing and when not on 32bit machine==