1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
public function CalculerMoyenne(prmNote1 as variant, prmNote2 as variant, prmNote3 as variant) as double
dim somme as double
dim cptNote as integer
if not isNull(prmNote1) then
somme=somme+prmNote1
cptNote=cptNote+1
end if
if not isNull(prmNote2) then
somme=somme+prmNote2
cptNote=cptNote+1
end if
if not isNull(prmNote3) then
somme=somme+prmNote3
cptNote=cptNote+1
end if
if cptNote<>0 then
CalculerMoyenne=somme/cptNote
else
CalculerMoyenne=0:'Ou tout autre valeur significative pour toi.
end if
end function |