The following sub attempts to get a value of Map from the RuleSet map.
The commented line returns "Map not Intialized" (' mr = RuleSet.Get(DefCM.CLogRule))
The For..Next block returns the map correctly.
Both return the value as object (Get and GetValueAt). Can''t see what is wrong?
The commented line returns "Map not Intialized" (' mr = RuleSet.Get(DefCM.CLogRule))
The For..Next block returns the map correctly.
Both return the value as object (Get and GetValueAt). Can''t see what is wrong?
B4X:
Sub GetCycleDays As Int
Dim mr As Map
Dim b As Boolean
Dim res,i,ky As Int
mr.Initialize
' mr = RuleSet.Get(DefCM.CLogRule)
For i = 0 To RuleSet.Size -1
ky = RuleSet.GetKeyAt(i)
If ky = DefCM.CLogRule Then
mr = RuleSet.GetValueAt(i)
Exit
End If
Next
Log(" returned map: "&mr)
b = mr.Get("cycle_max_on")
If b = True Then
res = mr.Get("cycle_max_onv")
Else
res = 0
End If
Return res
End Sub