Sub Process_Globals
Type StoreLocationType(StoreNumber As Int, Latitude As Int, Longitude As Int)
End Sub
Sub AppStart (Args() As String)
Log("Hello world!!!")
'// we try to >>
Dim a(20) As Int
Dim b(20) As Int
Dim c(20) As Int
'create sample random data
For I = 0 To a.Length - 1
a(I) = Rnd(1000, 9999 + 1) 'random store number
b(I) = Rnd(-90, 90 + 1) 'latitude
c(I) = Rnd(-180, 180) 'longitude
Next
Dim item As Map
item.Initialize
'''item.put(0, a(0), b(0), c(0)) 'try to add array data to map
'copy data from arrays into map (note that if the same store number appears more than once, then older store data will be replaced by newer store data)
For I = 0 To a.Length - 1
Dim StoreLocation As StoreLocationType
StoreLocation.StoreNumber = a(I)
StoreLocation.Latitude = b(I)
StoreLocation.Longitude = c(I)
item.Put(StoreLocation.StoreNumber, StoreLocation) 'if store number already exists in map, it will be replaced by this newer data
Next
'retrieve data from Map (in StoreNumber order, because we're For'ing through potential store numbers from 1000 to 9999)
For I = 1000 To 9999
If item.ContainsKey(I) Then
Dim sl As StoreLocationType = item.Get(I)
Log(sl.StoreNumber & TAB & "lat " & sl.Latitude & TAB & "lon " & sl.Longitude)
End If
Next
End Sub