Help pour un script
hamid-ma
Messages postés
19
Statut
Membre
-
hamid-ma Messages postés 19 Statut Membre -
hamid-ma Messages postés 19 Statut Membre -
bonjour, svp quelqu'un peut m explique a quoi il sert se script ..
-------------------------------------------------------------------------------------------
Public Function DayOfYear(ByVal year As Integer, ByVal month As Integer, ByVal day As Integer) As Integer
Dim x As Integer
Dim monthday() As Integer = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}
x = monthday(month - 1) + day
If ((year Mod 4 = 0) And ((year Mod 100.0! = 0) Or (year Mod 400 = 0)) And (month > 2)) Then
x = x + 1
End If
DayOfYear = x
End Function
------------------------------------------------------------------------------------------
merci d avance
-------------------------------------------------------------------------------------------
Public Function DayOfYear(ByVal year As Integer, ByVal month As Integer, ByVal day As Integer) As Integer
Dim x As Integer
Dim monthday() As Integer = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}
x = monthday(month - 1) + day
If ((year Mod 4 = 0) And ((year Mod 100.0! = 0) Or (year Mod 400 = 0)) And (month > 2)) Then
x = x + 1
End If
DayOfYear = x
End Function
------------------------------------------------------------------------------------------
merci d avance
A voir également:
- Help pour un script
- Script vidéo youtube - Guide
- Ghost script - Télécharger - Polices de caractères
- Mas script - Accueil - Windows
- Script cmd - Guide
- Script download - Télécharger - Édition & Programmation
PS: je ne suis un expert en VBA
year Mod 100.0! = 0
cette expression est sensée vouloir dire : le reste de la division entière de year par 100 est différent de zero.
en VB ou VBA ça s'écrit: year Mod 100 <> 0
ou encore Not (year Mod 100 = 0)
Le signe != est utilé en C; C++ ; Java
L'équivalent en VB est <>
De plus l'initialisation du tableau monthday() est incorrecte
Voilà la correction:
Colle ce code dans un module et exécutes test, sauf erreur ça devrait marcher