Sub Process_Globals
Type OutputType(Item As Int,Count As Int,Result As Float)
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Working code .......
Dim MyArray(6) As Int = Array As Int (99,13,99,13,99,15,99)
Dim MyMap As Map
Dim NumberOfItems As Int
Dim MyList As List
MyMap.Initialize
MyList.Initialize
For Each Item As Int In MyArray
'Use the Value stored in the map under the key to count the items
MyMap.Put(Item,MyMap.GetDefault(Item,0)+1)
Next
NumberOfItems = MyArray.Length
For Each Key As Int In MyMap.Keys
Dim R As OutputType
R.Item=Key
R.Count=MyMap.Get(Key)
R.Result=(R.Count*100)/NumberOfItems
MyList.Add(R)
Next
MyList.SortType("Result",False)
For Each R As OutputType In MyList
Log(R.Item&" "&R.Count&" "&NumberFormat(R.Result,2,2)&"%")
Next
End Sub