Android Tutorial B4A Beginners Guide

Mitchboo

Member
Licensed User
Longtime User
Hi.

Encountering an issue with Number1 and Number2 in the first program of the Beginner's guide.

I followed everything carefully, but it seems Number1 and Number2 do not really behave as global.

B4X:
Dim Number1, Number2 As Int
is in Sub Globals as instructed, but when the program kept telling me it was the wrong result, I added a MsgBox in CheckResult
B4X:
Msgbox("Value", Number1 + Number2)
And I get 0 (zero).

If I set the value in a line just before, it does display it. It seems these variables do not keep their value between events.

What am I missing ?

TIA
 

klaus

Expert
Licensed User
Longtime User
I tested it and it works.
I thought that it should be Msgbox("Value", (Number1 + Number2))
But even Msgbox("Value", Number1 + Number2) works.
According to your code the number is displayed in the title !

Otherwise post you project as a zip file (IDE menu File / Export As Zip) and I'll have a look at it.

Sorry for answering only now, because today I was HERE.
 

Ferbis

Active Member
Licensed User
Longtime User
Thank you very much once more for this splendid job. You are the best!!!
 

pjo12345

Active Member
Licensed User
Longtime User
There is a problem with the formatting in 4.1.1


 

MitchBu

Well-Known Member
Licensed User
Longtime User
Page 41 of the Beginner's Guide, it is mentioned :

The project is available in the SourceCode folder:
SourceCode\SecondProgram\SecondProgram.b4a


Could not locate any SourceCode folder in the installation folder. It does not seem there is any archive anymore for download.

Would appreciate pointers.

TIA
 

MitchBu

Well-Known Member
Licensed User
Longtime User
Well, it seems I have a knack to find missing things. In the same beginners guide, page 180, the tutorial goes :

Let us make an example based on the TestLayoutsAnchors project
(which can be found under the Guide\SourceCode\TestLayoutsAnchors directory):


And it is nowhere to be found

Search in the forum does not lead to any positive response, and even a Google search site:b4x.com "TestLayoutsAnchors" does not bring any result. I am starting to suspect that project has been abandonned long ago.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…