public Sub SortMapListByKeyValue(mapList As List, keyName As String, ascending As Boolean) As List
Dim keyValList As List
keyValList.Initialize
For Each m As Map In mapList
keyValList.Add(m.Get(keyName))
Next
keyValList.Sort(ascending)
Dim newList As List
newList.Initialize
For i=0 To keyValList.Size-1
For j=0 To mapList.Size-1
Dim m As Map = mapList.Get(j)
If m.Get(keyName)=keyValList.Get(i) Then
newList.Add(m)
mapList.RemoveAt(j)
Exit
End If
Next
Next
Return newList
End Sub