I have a strange problem with for next step -1
Code:
Dim n As Int =0
For i=listcevap.Size-1 To (listcevap.Size-TextField1.Text.Length) Step -1
If listcevap.Get(i) = TextField1.Text.CharAt(n) Then
listsonuc.Add("1")
Else
'Exit
End If
next
Now listcevap.size is 12. and textfield1.text.length is 4
so for next is between i=11 to 8 step -1
but during wathcing the logs i see that b4i first gets i=8 than 9 than 10 than 11 instead of first 11 than 10 than 9 than 8 (while geting the values of list )
What am i doing wrong ? I am about to go mad about this.
Add a breakpoint just before the For loop and go through the code step by step.
You may also put Logs showing the values of listcevap.Size and TextField1.Text.Length.
Yes i found the problem. Now the problem is for example textfield1.text.charat(1) = 3
and listcevap.get(i) = 4
i cant get the sum this two numbers it says "Error description: Cannot cast: {Type=Char,Rank=0, RemoteObject=True} to number."
i think b4i sees one as number one as charachter. How can i make it see both of them as numbers so i can get the sum for example ?
CharAt(1) returns a Char which you cannot use for arithmetic operations.
Try to use Dim n = textfield1.Text.CharAt(1) As Int
before calculating the sum.