//Clic sur cmdAjoute
//On test pour savoir si les champs ont été renseignés
Si SansEspace(txtArticle) = "" Alors Retour
Si txtTotal = 0 Alors Retour
//On recherche pour savoir si le produit existe dans la table
Indice est un entier
Indice = TableCherche(colArticle,txtArticle,Vrai)
//Vrai permet une recherche à l'indentique
Si Indice <> -1 Alors
//L'article existe dans la table
//On va ajouter quantité et valeur
TableSelectPlus(Table,Indice) //On se positionne sur la ligne
colQte += 1
colTotal += txtTotal
Sinon
//L'article n'existe pas on l'ajoute
TableAjoute(Table,txtArticle + TAB + "1" + TAB + txtTotal)
Fin
//Maintenant on tri la table
//Tri Croissant sur la colonne Article
TableTri(Table,"+colArticle")
Cette contribution était de : http://old.wdforge.org/newbb/viewtopic.php?forum=17&topic_id=4245&post_id=17486