iOS Question b4a vs b4i char object

ilan

Expert
Licensed User
Longtime User
hi.

I noticed that the char object in b4a is not the same as in b4i.

for example, I use a Hebrew letter with NIKKUD and if I go through the string with x.charAt() function I get instead of letter numbers.
what I do is I convert it back to a string and then it is fine. in b4a I don't have to do that.

am I doing something wrong or is ios handling chars different than android?

thanx, ilan
 

ilan

Expert
Licensed User
Longtime User
Post the code...

B4X:
Private hebrewletters As String= "אבגדהוזחטיכלמנסעפצקרשתךםןףץ"
...


Sub haslegalwords (txt As String) As Boolean 'ignore
    If txt.Length = 0 Then Return False
    Dim foundhebrewletters As Boolean = False
   
    For i = 0 To txt.Length - 1
        Dim c As Char = txt.CharAt(i)
        If hebrewletters.Contains(c) Then
            foundhebrewletters = True
            Exit
        End If
    Next
    Return foundhebrewletters
End Sub

but in ios i do this:

B4X:
Dim c As Char = txt.CharAt(i)
Dim letter As String = c
...

because c in ios returns a number.

btw. this is the app :

yesterday i converted it to ios and now it is in testing phase in few days i will also upload the ios version
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
I'm unable to reproduce it based on your code though converting to string is probably the correct solution and will also work in B4A.

sorry erel it was the wrong code to demonstrate the issue (i am now at work and have not the b4i version on me) anyway thank you i will convert the char to string also in the android version.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…