basic mathematical operation

seiji101

New Member
hello there im new in programming with basic4android and i would like to ask how to do a basic mathematical operation..
can anyone help me pls... thank you

ive tried this one but it wont work it gives me an error..

B4X:
Sub Globals
   dim score as int
        score = 0
        lscore as label
End Sub
Sub balk_Click
   score + 2
   lscore = score 
End Sub
 

seiji101

New Member
thanks for the help.. but now i have another problem.. i want to do is every time a click the button the score will add 2...
 
Last edited:
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
Well, that is fine. Just add the syntax corrections to your original code.

B4X:
Sub Globals
    Dim score as int: score = 0
    Dim lscore as label
End Sub

Sub balk_Click
    score = score + 2
    lscore.text = score 
End Sub
 
Upvote 0
Top