Sub Process_Globals
Type t1(memberX As String)
Type t2(memberY As String)
End Sub
Sub TypeTesting(o As Object)
If o Is t1 Then
Log("t1")
else if o Is t2 Then
Log("t2")
End If
End Sub
...could be written like this:
B4X:
Sub Process_Globals
Type t1(memberX As String)
Type t2(memberY As String)
End Sub
Sub TypeTesting(o As Object)
Select o
case Is t1
Log("t1")
case Is t2
Log("t2")
End Select
End Sub
...or like this:
B4X:
Sub Process_Globals
Type t1(memberX As String)
Type t2(memberY As String)
End Sub
Sub TypeTesting(o As Object)
Select o is
case t1
Log("t1")
case t2
Log("t2")
End Select
End Sub
Yes, but I still would love to do it in the way I suggest. The "Select Case True" methode is not so intuitive and readable as my sugestion. It is not "true" I want to test, it is the variable "o" I want to test. See this thread: