Formerly I don't have to worry so much about data type as IDE takes care of it for me, Example if i have string variable = "2" and i have integer variable = 2 and I compare, i will get true but no more.
Here are two scenarios where that no longer work:
I have a php script
then I also have B4A using okhttputils to get the result
Dim ok As HttpJob
ok.Initialize("",Me)
ok.Download(mhyurl)
Wait For Jobdone (ok As HttpJob)
If ok.Success Then
Dim res As String
res = ok.GetString
If res = "failed" Then
Log("yes")
Else
Log("no")
End If
End If
But then I was getting No. I had to do res.trim before the comparism worked and I dont know why because the php does not have any space anywhere in the echo statement
Today too I have this scenario. I have some few labels and i set tag for them in the designer as 1,2,3 with same event name
i have this code in a label click event
Private Sub lblLeftMenu_Click
Dim l As B4XView = Sender
Log(l.Tag)
Select l.Tag
Case 1
Log("1 here")
Case 2
Log("2 here")
Case 3
Log("3 here")
End Select
End Sub
But then it was also NOT working, when i check the type for l.tag it gives string, so have to declare another integer variable and cast the l.tag before it worked