How to add numbers to a number

B4X:
Sub ImageView1_Click
   Select Msgbox2("Would You Like To By This?" , "Conferm Order" , "yes","Cancel" , "no" ,LoadBitmap(File.DirAssets,"bud_icon_007.jpg"))    
    
     Case DialogResponse.POSITIVE
      money1 = money1 - "20"
      label1.Text = ""
      label1.Text = "$" & money1
      imageview1.Bitmap = LoadBitmap(File.DirAssets,"bud1owned.jpg")
      ownedamountitem1 = ownedamountitem1 + "1"
      imageview3.Bitmap = LoadBitmap(File.DirAssets,"bud_icon_007.jpg")
      labelitemamount1.Text = ownedamountitem1
    Case DialogResponse.NEGATIVE
        
    Case Else
        ToastMessageShow("No",False)
End Select
End Sub
see my problem is here
B4X:
ownedamountitem1 = ownedamountitem1 + "1"
 

stevel05

Expert
Licensed User
Longtime User
It's not actually label1 that's causing the issue, it's a label called money that isn't in the designer layout.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
And as Label1 is added with the designer, you don't need to initialize it again in line 47.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
You have more than one set of quotes around numbers.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
labelitemamount1 is not in any of the layouts, So that's the next error you will get.
 
Upvote 0
got one more error
*** Remote compilation mode ***
Parsing code. 0.03
Compiling code. 0.17
Compiling layouts code. 0.02
Sending data to remote compiler. Error
step: Compiling generated Java code.
B4A line: 159
Msgbox(\
javac 1.7.0_09
src\b4a\example\main.java:444: error: case, default, or '}' expected
anywheresoftware.b4a.keywords.Common.Msgbox("You Have None ","Nuffing to smoke",mostCurrent.activityBA);
^
1 error
 
Upvote 0

Geezer

Active Member
Licensed User
Longtime User
I assume this is your first B4A app and I congratulate you on getting it working. You had quite a few issues to work out there. :sign0098:

What I would suggest now to make it more user friendly is to add the store to a second activity instead of a different panel. That way the code for each section is confined to it's own activity. Also, if the store was on another activity and you pressed back it would take you back to your main activity.
 
Upvote 0
Top