public function NbMot(Texte ,RchTxt) as single NbMot=0 dim tmp,longueur tmp=1 longeur=len(RchTxt) do while tmp<>0 And Len(Texte)>Len(RchTxt) tmp=instr(Texte,RchTxt) if tmp<>0 Then if strcomp(Mid(Texte,tmp+longeur,1)," ")=0 then If tmp<2 Then NbMot = NbMot + 1 Else If strcomp(Mid(Texte,(tmp-1),1)," ")=0 Or strcomp(Mid(Texte,(tmp-1),1),"'")=0 Then NbMot = NbMot + 1 End If End If End If Texte=Mid(Texte,tmp+longeur) End if Loop End Function
< : corespond au signe inférieur > :corespond au signe supérieur <> : corespond au signe différent
public function NbMot(Texte ,RchTxt) as single NbMot=0 dim tmp,longueur tmp=1 longeur=len(RchTxt) do while tmp<>0 And Len(Texte)>Len(RchTxt) tmp=instr(Texte,RchTxt) if tmp<>0 Then if strcomp(Mid(Texte,tmp+longeur,1)," ")=0 then If tmp<2 Then NbMot = NbMot + 1 Else If strcomp(Mid(Texte,(tmp-1),1)," ")=0 Or strcomp(Mid(Texte,(tmp-1),1),"'")=0 Then NbMot = NbMot + 1 End If End If End If Texte=Mid(Texte,tmp+longeur) End if Loop End Function
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question