### File Write and ReadMap

The File.WriteMap and File.ReadMap methods work only if the map holds strings and numbers.
For all other types use B4XSerializator.
File.WriteMap
Dim WeekDays As Map = CreateMap(1: "Monday", 2: "Tuesday", 3: "Wednesday", 4:"Thursday", 5: "Friday", 6: "Saturday", 7: "Sunday")
'Write the content of the map to a file
File.WriteMap(File.DirApp, "weekdays.map", WeekDays)
Content file weekdays.map
#Wed Mar 30 11:55:35 CEST 2016
6=Saturday
5=Friday
4=Thursday
3=Wednesday
2=Tuesday
1=Monday
7=Sunday
File.ReadMap
Read the content of above file into a map
Dim wds As Map = File.ReadMap(File.DirApp, "weekdays.map")
'Iterate over both map keys and values
'IMPORTANT: The weekday must be of type String and not int (else result is null)
For Each WeekDayNumber As String In wds.Keys
Dim WeekDay As String = wds.Get(WeekDayNumber)
Log($"Weekday number: ${WeekDayNumber}, value: ${WeekDay}"$)
Next

Changed: , Category: Map, File: T6C217M1596.htm, ID: 1596