Voici un prog qui calcule paques ascension et pentecôtes en fonction de l'année...
Source / Exemple :
VERSION 5.00
Begin VB.Form frmPrinc
Caption = "Jours Fériés..."
ClientHeight = 2160
ClientLeft = 60
ClientTop = 345
ClientWidth = 2670
Icon = "frmPrinc.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 2160
ScaleWidth = 2670
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton cmdGo
Caption = "&Go"
Height = 435
Left = 720
TabIndex = 1
Top = 480
Width = 1215
End
Begin VB.TextBox txtYear
Height = 285
Left = 0
TabIndex = 0
Top = 0
Width = 2655
End
Begin VB.Label lblPentecotes
Height = 255
Left = 0
TabIndex = 4
Top = 1800
Width = 2655
End
Begin VB.Label lblAscension
Height = 255
Left = 0
TabIndex = 3
Top = 1440
Width = 2655
End
Begin VB.Label lblPaques
Height = 255
Left = 0
TabIndex = 2
Top = 1080
Width = 2655
End
End
Attribute VB_Name = "frmPrinc"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Function modulo(number1, number2)
modulo = number1 Mod number2
End Function
Private Sub cmdGo_Click()
On Error GoTo error
an = txtYear.Text
mois = 3
jour = 22 + modulo(19 * modulo(an, 19) + 24, 30) + modulo(2 * modulo(an, 4) + 4 * modulo(an, 7) + 6 * modulo(19 * modulo(an, 19) + 24, 30) + 5, 7)
If jour / 31 > 1 Then
mois = mois + 1
jour = jour - 31
End If
lblPaques.Caption = "Pâques : " & Format(jour & "/" & mois & "/" & an, "Dddd dd Mmmm yyyy")
jour = jour + 9
mois = mois + 1
If jour / 31 > 1 Then
mois = mois + 1
jour = jour - 31
End If
lblAscension.Caption = "Ascension : " & Format(jour & "/" & mois & "/" & an, "Dddd dd Mmmm yyyy")
jour = jour + 10
If jour / 31 > 1 Then
mois = mois + 1
jour = jour - 31
End If
lblPentecotes.Caption = "Pentecôtes : " & Format(jour & "/" & mois & "/" & an, "Dddd dd Mmmm yyyy")
Exit Sub
error:
If Err.Number = 13 Then
MsgBox "Il me faut une année...", vbExclamation, "Erreur..."
Err.Clear
Else
r = MsgBox("Une erreur inattendue est survenue." & vbCrLf & vbCrLf & "Numéro de l'erreur : " & vbCrLf & Err.Number & vbCrLf & vbCrLf & "Description de l'erreur : " & vbCrLf & Err.Description, vbExclamation, "Erreur...")
Err.Clear
Resume Next
End If
End Sub
Conclusion :
Et n'oubliez pas d'aller à l'église...
www.vatican.com
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.