Hello,
I have a sub which helps me to read map objects as follows:
The problem is that if I call GetTextItem passing a List object instead of a Map object, the compiler doesn't warn me about the error, but it will be thrown at Runtime.
Example:
Further, I noticed that in this case the Application_Error didn't fire.
Any help is much appreciated, thank you.
Antonello
I have a sub which helps me to read map objects as follows:
B4X:
Sub GetTextItem(Rec As Map, FieldName As String) As String
Dim ret As String
ret=""
Try
ret=DecodeString(Rec.Get(FieldName))
Catch
Log("GetTextItem")
End Try
Return ret
End Sub
The problem is that if I call GetTextItem passing a List object instead of a Map object, the compiler doesn't warn me about the error, but it will be thrown at Runtime.
Example:
B4X:
dim ls as List
ls.initialize
'add some items
log( GetTextItem(ls, "DUMMY") ) ' this should be handled by the compiler
Further, I noticed that in this case the Application_Error didn't fire.
Any help is much appreciated, thank you.
Antonello