Ah ok I understand now! I really like this world, I will definitely ask another questions being a beginner, thanks !! For work we all have projects on Default and not B4XPages, but I try to study that too.
Ok, me having come from a strong Access and VB desktop background?
Well, first, I never have given credit to one REALLY silly and simple feature of B4A? And that feature is this:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Do you all see it? it is so simple, so not noticed. That is the blank code template with those BEYOND simple and helpful comments!!!
I jump around so many platforms in a day - it is HARD to remember. So, I cannot state how many late nights - and those simple, bare bones, limited, but most welcome comments? They helped me - a LOT!! They shortened the learning curve of B4A.
I kind of wish more platforms did this. Just thought I would give a kind shout out to something that we don't really notice - but those default comments really do deserve a group hug.
So, often to pass values? Well I don't have say parameters to the next "form" to open.
So, I tend to think of launch new form (next form?). That is this:
Sub btnForm1_Click
Form2.strMyPassedTextValue = "my value to pass"
StartActivity(Form2)
End Sub
So above will launch my Form2. Now not all forms (layout) need their own activity. But the idea is quite much:
Add the activity, then add the form. They are often paired up this way. And the trick of when to create a activty or not?
Well, that just a learning curve.
And if you hit the back key on your phone, the form will close and we return to previous.
or we can have a close button on that 2nd form such as:
Sub btnBack_Click
Activity.Finish
End Sub
And the code to shove that "passed" value into a text box? we have this
in our so called "load event"
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("Form1")
If FirstTime Then
EditText1.Text = strMyPassedTextValue
End If
End Sub
Now not in all cases do you need a "whole new" code module (activity) paired up with a layout, but I don't mind this setup.
One good aspect? It moves code into the given layout.
I starting to shove too much code into one spot - so fighting this urge somewhat!
And, in the sprit of the holidays? Well, I JUST minutes ago finally upgraded from B4A 9.0x to current.
(IDE: like the project close button! (really!!! - I always wanted that!!!)
(like the more zoom levels).
(like the use of space up top with the module tabs - nice!)
And I JUST did my first B4xpage. Its is nice.
I'll start absorbing what options to break code out to additonal modules - and when to do so.
(this is not 100% clear in my brain just quite yet).
Reduction of having to deal (fight) with Activity? yes - that is welcome.
So, it not more then really 10 minutes ago - my first try at this!
I can say that having grasped how B4A works? Then the jump to B4A pages is MUCH less of a curve then I expected.
Really - might have missed something - but I was expecting more hardship! - there was little!!
And to be fair? Well, I do much respect how B4A does continue and allow me to work with the benefits of activities, and how VERY cool that architecture of Android is in this regards.
Very busy - but at least I have the new B4A up and running. The emulator not working - spitting out some errors - but don't use it much - and am busy - it was try and fix that or write this post!!).
Regards,
Albert D. Kallal
Edmonton, Alberta Canada