I'd assume that following code will sort List a() and also ALL nested Lists a()\b() ascending. But only the first nested List gets sorted...
Code: Select all
Structure SB
name$
EndStructure
Structure SA
name$
List b.SB()
EndStructure
Global NewList a.SA()
RandomSeed(1)
; fill
For i=2 To 0 Step - 1
AddElement(a())
a()\name$ = "Item " + Str(i)
For j=0 To 9
AddElement(a()\b())
a()\b()\name$ = Chr(Random(90, 65)) + Chr(Random(122, 97))
Next
Next
; sort
If 1
ForEach a()
SortStructuredList(a(), #PB_Sort_Ascending, OffsetOf(SA\name$), TypeOf(SA\name$))
ForEach a()\b()
SortStructuredList(a()\b(), #PB_Sort_Ascending, OffsetOf(SB\name$), TypeOf(SB\name$))
Next
Next
EndIf
; debug
ForEach a()
Debug a()\name$
ForEach a()\b()
Debug Chr(9) + a()\b()\name$
Next
Next