### Create a sorted Typed List

An example of creating a list with types which is sorted.
`Sub Process_Globals
Type ContactType (Name As String, EMail As String, ID As Int)
Private ContactList As List
...
'Create a sorted typed list. Sorted by field Name
'Type ContactType (Name As String, EMail As String, ID As Int)
`Sub CreateContactList
ContactList.Initialize
For i=0 To 4
Dim ct As ContactType
Dim name As String = RandomName(4)
ct.Name = $"${name}"$
ct.EMail = $"${name}@email.adresse"$
ct.ID = i
ContactList.Add(ct)
Next
ContactList.SortType("Name", True)
End Sub`
'Log the list of contacts
`Sub ListContactList
For Each ct As ContactType In ContactList
Log($"${ct.Name},${ct.EMail},${ct.ID}"$)
Next
End Sub`
'Create a randomname with lenght l
`Sub RandomName(l As Int) As String
Dim sb As StringBuilder
sb.Initialize
For i = 0 To 3
sb.Append(Chr(Rnd(65, 90)))
Next
Return sb.ToString
End Sub`
Example Output
AJXJ,AJXJ@email.adresse,3
DECY,DECY@email.adresse,2
HYXN,HYXN@email.adresse,1
PASJ,PASJ@email.adresse,0
TQBO,TQBO@email.adresse,4
`

Changed: , Category: Lists, File: T6C215M1568.htm, ID: 1568