Code: Alles auswählen
Structure MyStruc
Name.s
Age.b
List Friends.MyStruc()
EndStructure
NewList PersonList.MyStruc()
; Person hinzufügen
AddElement(PersonList()): PersonList()\Name = "Alexander"
; Freunde der Person hinzufügen
AddElement(PersonList()\Friends())
PersonList()\Friends()\Name = "Kevin"
PersonList()\Friends()\Age = 22
AddElement(PersonList()\Friends())
PersonList()\Friends()\Name = "Sascha"
PersonList()\Friends()\Age = 26
AddElement(PersonList()\Friends())
PersonList()\Friends()\Name = "Patrick"
PersonList()\Friends()\Age = 21
SortStructuredList(PersonList()\Friends(),#PB_Sort_Ascending,OffsetOf(MyStruc\Age),#PB_Byte)
ForEach PersonList()\Friends()
Debug PersonList()\Friends()\Age
Next