Help Newbie first project

fraxinus

Member
Licensed User
Longtime User
I,ve got everything up and running software and hardware.
First project test. Everyhing displaying on device but the Button_Click not working on program.
Any help would be appreciated.
Thanks
Rob

'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.

End Sub

Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.

End Sub

Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Velocity")
End Sub

Sub Button1_Click
Dim miles As Int
Dim yards As Int
Dim result As Int
result = miles + yards
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
 

dagnabitboy

Active Member
Licensed User
Longtime User
Hi Rob, your program is simple enough, and it probably is working just fine, it's just that you haven't put the result anywhere where you can see it. If you were to add a label you could output it to the label, or you can log it back to the B4a IDE on your computer.

add a label to your layout and add the following code:
label1.text=result

or send it back to the log screen. On the right hand panel of the IDE at the bottom you'll see an option for logging. in your code add the following:
Log(result)

or if you want to label the output string add:

Log("the result is = " & result)
 
Upvote 0
Top