All pastes #342037 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-02-06 01:28 UTC
rendered paste body
-- Leike main ok!?

   if Date < NextDate then
      Put(Date); Put(" < "); Put(NextDate);
   else
      Put(Date); Put(" > "); Put(NextDate);
   end if;



-- TEh operatorz!ok?!

   function "<"(L, R : in Date_Type) return Boolean is

      Numeric_L : Integer;
      Numeric_R : Integer;

   begin

      Numeric_L := ((L.Year * 128) + (L.Month * 64) + L.Day);
      Numeric_R := ((R.Year * 128) + (R.Month * 64) + R.Day);

      if Numeric_L < Numeric_R then
         return L < R;
      else
         return R < L;
      end if;

   end "<";