Sub Read
Log("Reading")
If File.Exists(File.DirInternal, DATES_FILENAME) Then
mmapDates = File.ReadMap(File.DirInternal, DATES_FILENAME)
Log(mmapDates)
For Each key As String In mmapDates.Keys
If key = DATES_FIRST_KEY Then
Dim lngDate As Long = mmapDates.Get(key)
AnotherDatePicker1.Date = lngDate
End If
Next
End If
End Sub
Sub Read
Log("Reading")
If File.Exists(File.DirInternal, DATES_FILENAME) Then
mmapDates = File.ReadMap(File.DirInternal, DATES_FILENAME)
Log(mmapDates)
'For Each key As String In mmapDates.Keys
' If key = DATES_FIRST_KEY Then
Dim lngDate As Long = mmapDates.Get(DATES_FIRST_KEY)
AnotherDatePicker1.Date = lngDate
'End If
'Next
End If
End Sub
Yes. But as you are using File.WriteMap all Values are converted to Strings! So after File.ReadMap all Keys are Strings. You then try to access the Key using an Int and this leads into a null because the Key does not exists.
The next problem was different (and I will open a new thread, probably), related to AnotherDatePicker (it seems to not allow dates before 1970 and... I was born before )