Thread: turni di lavoro
View Single Post
  #4 (permalink)  
Old 03-17-2008, 02:20 PM
maXim's Avatar
maXim maXim is offline
Senior Member
 
Join Date: May 2007
Location: Florence, Italy
Posts: 135
Send a message via MSN to maXim Send a message via Skype™ to maXim
Post

Ciao Cerro41,

ben arrivato su questo forum...


Quello che ti prospetto è un semplice algoritmo per il calcolo della Pasqua che utilizzo da diverso tempo anche con altri compilatori:
Sub easter_day(yyyy)
a = yyyy Mod 19
b = Int(yyyy / 100)
c = yyyy Mod 100
d = Int(b / 4)
e = b Mod 4
f = Int((b + 8) / 25)
g = Int((b - f + 1) / 3)
h = (19 * a + b - d - g + 15) Mod 30
i = Int(c / 4)
k = c Mod 4
l = (32 + 2 * e + 2 * i - h - k) Mod 7
m = Int((a + 11 * h + 22 * l) / 451)
e_d = Format(((h + l - 7 * m + 114) Mod31) + 1, "D2") & "/" & Format(Int((h + l - 7 * m + 114) / 31), "D2") & "/" & yyyy
Return e_d
End Sub
Saluti,

Massimo

P.S. al link sottostante trovi nel file compresso un piccolo esempio che utilizza l'algoritmo sopra citato.
Attached Files
File Type: zip easter day.zip (710 Bytes, 11 views)

Last edited by maXim : 03-17-2008 at 07:01 PM.
Reply With Quote