Code : Tout sélectionner
;Trie d'une structure
Structure Potager
Nom.s
Famille.s
EndStructure
Dim MonPanier.Potager(4)
Dim CopieMonPanier.Potager(4)
MonPanier(0)\Nom="Pomme"
MonPanier(0)\Famille="Fruit"
MonPanier(1)\Nom="Concombre"
MonPanier(1)\Famille="Legume"
MonPanier(2)\Nom="Peche"
MonPanier(2)\Famille="Fruit"
MonPanier(3)\Nom="Tomate"
MonPanier(3)\Famille="Legume"
MonPanier(4)\Nom="Abricot"
MonPanier(4)\Famille="Fuit"
;Tri d'une structure
SortStructuredArray(MonPanier(), #PB_Sort_Ascending|#PB_Sort_NoCase, OffsetOf(Potager\Nom), #PB_Sort_String)
;Teste
For i=0 To 4
Debug Monpanier(i)\Nom
Next