- 'Fonction de vérification de date au format JJ.MM.AAAA
- function checkdate(d)
- 'devloppé par Seren
- 'Ver 1.0
-
- res=instr(d,".")
- if res>0 then
- jour=mid(d,1,res-1)
- if isnumeric(jour) then
- if jour>0 AND jour<32 then
- res2=instr(res+1,d,".")
- if res2>0 then
- mois=mid(d,res+1,res2-res-1)
- if isnumeric(mois) then
- if mois>0 AND mois<13 then
- an=mid(d,res2+1,len(d))
- if isnumeric(an) then
- if an<2099 then
- msg="ok"
- else
- msg="Année non valide"
- end if
- else
- msg="Année non valide"
- end if
- else
- msg="Mois non valide"
- end if
- else
- msg="Mois non valide"
- end if
- else
- msg="Format non valide (JJ.MM.AAAA)"
- end if
- else
- msg="Jour non valide"
- end if
- else
- msg="Jour non valide"
- end if
- else
- msg="Format non valide (JJ.MM.AAAA)"
- end if
- if msg<>"ok" then
- checkdate=msg
- else
- checkdate=True
- end if
- end function
'Fonction de vérification de date au format JJ.MM.AAAA
function checkdate(d)
'devloppé par Seren
'Ver 1.0
res=instr(d,".")
if res>0 then
jour=mid(d,1,res-1)
if isnumeric(jour) then
if jour>0 AND jour<32 then
res2=instr(res+1,d,".")
if res2>0 then
mois=mid(d,res+1,res2-res-1)
if isnumeric(mois) then
if mois>0 AND mois<13 then
an=mid(d,res2+1,len(d))
if isnumeric(an) then
if an<2099 then
msg="ok"
else
msg="Année non valide"
end if
else
msg="Année non valide"
end if
else
msg="Mois non valide"
end if
else
msg="Mois non valide"
end if
else
msg="Format non valide (JJ.MM.AAAA)"
end if
else
msg="Jour non valide"
end if
else
msg="Jour non valide"
end if
else
msg="Format non valide (JJ.MM.AAAA)"
end if
if msg<>"ok" then
checkdate=msg
else
checkdate=True
end if
end function