iOS Question CS builder trying to convert B4A to B4I

tsteward

Well-Known Member
Licensed User
Longtime User
In converting my app I'm not sure why this code crashes. Partly because I don't understand CSbuilder but ide does not show any error.
B4X:
Dim cs As CSBuilder
            cs.Initialize.Color(Colors.Black).Append(Code & " > ")
            Dim endLength As Int = cutsLegendSideA.Length - 1
            Dim startpos As Int = 0
            If B4XPages.MainPage.currentTool = "HU83" Then
                startpos = 1
            End If
            For i = startpos To endLength
                If CutsA(i).Text.Contains(Bitting.CharAt(i-startpos)) Then
                    #if b4a
                    cs.Bold.Color(Colors.White).Append(Bitting.CharAt(i-startpos)).Pop.Pop
                    #else if b4i
'**** Errors here ****'
                    cs.Color(Colors.White).Append(Bitting.CharAt(i-startpos)).Pop.Pop
                    #End If
                Else
                    #if B4A
                     cs.Bold.Color(Colors.rgb(49,45,45)).Append(Bitting.CharAt(i-startpos)).Pop.Pop
                     #else if B4I
                    cs.Color(Colors.rgb(49,45,45)).Append(Bitting.CharAt(i-startpos)).Pop.Pop
                     #end if
                End If
            Next
            If cutsLegendSideB.Length > 0 Then
                cs.Color(Colors.Black).Append("-").pop
            End If
            For i = 0 To cutsLegendSideB.Length - 1
                If CutsB(i).Text.Contains(Bitting.CharAt(cutsLegendSideA.Length + i + 1)) Then
                    #if B4A
                     cs.Bold.Color(Colors.White).Append(Bitting.CharAt(cutsLegendSideA.Length + i + 1)).Pop.Pop
                     #else if B4I
                    cs.Color(Colors.White).Append(Bitting.CharAt(cutsLegendSideA.Length + i + 1)).Pop.Pop
                     #end if
                Else
                    #if B4A
                     cs.Bold.Color(Colors.rgb(49,45,45)).Append(Bitting.CharAt(cutsLegendSideA.Length + i + 1)).Pop.Pop
                     #else if B4I
                    cs.Color(Colors.rgb(49,45,45)).Append(Bitting.CharAt(cutsLegendSideA.Length + i + 1)).Pop.Pop
                     #end if
                End If
            Next
            cs.PopAll
            Tree.AddItem(keyblank,cs,Null,"")

Error
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…