Android Question Compiler Debugger Error

jkhazraji

Active Member
Licensed User
Longtime User
I am trying to debug or compile a b4a file with no error on IDE but I get the error shown in the following picture, I do not know why ??
Error.jpg

Please Any Help..esp Erel..
 
Last edited:

jkhazraji

Active Member
Licensed User
Longtime User
It also occurs on configuring javac.exe path to jdk1.8.0_77
 
Upvote 0

fixit30

Active Member
Licensed User
Longtime User
Hello.

I see two issues preventing compilation.

Firstly, your getBtnText function is causing issues, however it is not needed. Just replace all occurences of getBtnText() with btntext()

For example:

B4X:
Sub ComputerBlocks(x As Int, y As Int, z As Int) As Boolean
'------------------------------------------------------------------------------------
'
'    This routine determines whether or not the computer must block the player
'    to prevent the player from winning on his or her next move ...
'
'------------------------------------------------------------------------------------
 
    If getBtnText(x) = "" And getBtnText(y) = gstrPlayerLetter And getBtnText(z) = gstrPlayerLetter Then
        getBtnText(x) = gstrComputerLetter
        Return True
    End If
 
 
    If getBtnText(x) = gstrPlayerLetter And getBtnText(y) = "" And getBtnText(z) = gstrPlayerLetter Then
        getBtnText(y) = gstrComputerLetter
        Return  True
    End If
 
 
    If getBtnText(x) = gstrPlayerLetter And getBtnText(y) = gstrPlayerLetter And getBtnText(z) = "" Then
     
        getBtnText(z) = gstrComputerLetter
        Return  True
    End If
 
    Return False
End Sub


Becomes:

B4X:
Sub ComputerBlocks(x As Int, y As Int, z As Int) As Boolean
'------------------------------------------------------------------------------------
'
'    This routine determines whether or not the computer must block the player
'    to prevent the player from winning on his or her next move ...
'
'------------------------------------------------------------------------------------
 
    If btntext(x) = "" And btntext(y) = gstrPlayerLetter And btntext(z) = gstrPlayerLetter Then
        btntext(x) = gstrComputerLetter
        Return True
    End If
 
 
    If btntext(x) = gstrPlayerLetter And btntext(y) = "" And btntext(z) = gstrPlayerLetter Then
        btntext(y) = gstrComputerLetter
        Return  True
    End If
 
 
    If btntext(x) = gstrPlayerLetter And btntext(y) = gstrPlayerLetter And btntext(z) = "" Then
     
        btntext(z) = gstrComputerLetter
        Return  True
    End If
 
    Return False
End Sub

The second problem is with the TakeComputerTurn Sub. You have:

B4X:
If ComputerWins(0, 1, 2) Then GameOver (mintCOMPUTER_WINS, 0): Exit

It should be:

B4X:
    If ComputerWins(0, 1, 2) Then
        GameOver (mintCOMPUTER_WINS, 0)
        Return
End If
 
Upvote 0
Top