Dim Countries() As String = Array As String( _
"English", "Thai", _
"Malaysia", "มาเลเซีย", _
"Canada", "แคนาดา", _
"Germany", "เยอรมนี", _
"Thailand", "ไทย", _
"UK", "สหราชอาณาจักร", _
"Spain", "สเปน", _
"France", "ฝรั่งเศส", _
"USA", "สหรัฐอเมริกา", _
"Israel", "อิสราเอล", _
"Italy", "อิตาลี", _
"Australia", "ออสเตรเลีย" _
)
For Language = 0 To 1
Dim L As List
L.Initialize
For I = 2 + Language To Countries.Length - 1 Step 2
L.Add(Countries(I))
Next
Dim Longest As Int = 0
For Each S As String In L
If S.Length > Longest Then Longest = S.Length
Next
For Sorted = 0 To 1
If Sorted = 1 Then L.Sort(True)
Log(Chr(160)) 'blank line to separate groups
Dim sb As StringBuilder
sb.Initialize
sb.Append("===== ")
sb.Append(Array As String("Unsorted", "Sorted")(Sorted))
sb.Append(" ")
sb.Append(Countries(Language))
sb.Append(" =====")
Log(sb.ToString)
For Each S As String In L
Dim sb As StringBuilder
sb.Initialize
sb.Append(S)
For I = S.Length + 1 To Longest
sb.Append(" ")
Next
For I = 0 To S.Length - 1
sb.Append(" " & Asc(S.CharAt(I)))
Next
Log(sb.ToString)
Next
Next
Next