Android Question Problem with an array

interlnk

Member
Licensed User
Why this is not right?
B4X:
dim text as string = "Hello"
dim arr(1) as array
arr(0) = text
If text = arr(0) Then
    ToastMessageShow("Hello", False)
End If
 

ronell

Well-Known Member
Licensed User
Longtime User
B4X:
dim text as string = "Hello"
dim arr(1) as string ' <-----
arr(0) = text
If text = arr(0) Then
    ToastMessageShow("Hello", False)
End If
 
Upvote 0

interlnk

Member
Licensed User
Sorry. The code was:
B4X:
dim text as string = "Hello"
dim arr(1) as String
arr(0) = text
If text = arr(0) Then
    ToastMessageShow("Hello", False)
End If
 
Upvote 0
Top