hello gene

maybe the following function will help you a littel bit:

on Get_Day_of_the_Week theYear, theMonth, theDay, theLanguage
  is_leap_year = #false
  dL = [31,28,31,30,31,30,31,31,30,31,30,31]
  if (theYear mod 4 = 0) then
    if ( (theYear mod 100 > 0) or (theYear mod 400 = 0) ) then
      dL[2] = 29
      is_leap_year = #true
    end if
  end if
  case (theLanguage) of 
    #gb:
      wDayList = [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", 
"Saturday"]
    #d:
      wDayList = [ "Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", 
"Freitag", "Samstag"]
  end case
  d = theDay
  -- test the day:
  if ( d >  dl[theMonth] ) then 
    day_exist = #false
  else
    day_exist = #true
  end if
  
  m = theMonth -1
  repeat with i = 1 to m
    d = d + dl[i]
  end repeat
  
  j = theYear - 1
  t = j + (j/4) - (j/100) + (j/400) + d
  
  x = (t mod 7) +1
  
  return [#day_exist: day_exist, #day: getAt(wDayList, x), #leap_year: is_leap_year]
end

ex.:

put Get_Day_of_the_Week (1966, 1, 3, #d)
-- [#day_exist: #true, #day: "Montag", #leap_year: #false]

regards
dietrich roland

[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to