Re: Occurrence dans une table

Posté par veDengaG le 24/8/2007 16:54:13
Bonjour, alors :

NbOcc, NbCol, NbLig, i, j sont des entiers
sRech est une chaîne="Chaine à trouver"

NbCol=TableOccurrence(tbRech,toColonne)
NbLig=TableOccurrence(tbRech)

POUR i=1 A NbLig //Parcours des lignes
	POUR j=1 A NbCol//Parcours des colonnes
		SI Position(tbRech[i][j],sRech)>0 ALORS
			NbOcc++
		FIN
	FIN
FIN
Info("'"+sRech+"' apparait "+NbOcc+" fois.")



Saisi à la volée, donc à vérifier

Cette contribution était de : http://old.wdforge.org/newbb/viewtopic.php?forum=17&topic_id=5356&post_id=22113