Android Question Public variable declaration while using b4XPages

beelze69

Active Member
Licensed User
Longtime User
Hi,

In an app being designed using b4XPages, I have declared a Public Long variable in Process_Globals in Starter.bas

However, the IDE Intellisense requires me to access it as Starter.<variable name> and not directly.

My doubts:

1) Is it safe to refer to the variable in all the b4X Pages as Starter.<variable name> [both for GETting and SETting its value] ?

2) Which is the best place(other than Starter.bas) to declare Public variables which will be accessed by all b4X Pages?

3) Is there any way I can refer to the variable as simply <variable name> (instead of prefixing it with the Module name viz. here Starter) ?

Sorry if I sound too basic.

Thanks.
 

agraham

Expert
Licensed User
Longtime User
1) Not only safe but a requirement.

2) You can access any Public variable in Class_Globals in the instance of a page or in Main.Process_Globals. Whether you should is a matter of style. If the variable is of app wide significance I would put it in Starter but if it was relevant to the operation of a page instance I would put it in the the page globals.

3) No
 
Upvote 0

beelze69

Active Member
Licensed User
Longtime User
1) Not only safe but a requirement.

2) You can access any Public variable in Class_Globals in the instance of a page or in Main.Process_Globals. Whether you should is a matter of style. If the variable is of app wide significance I would put it in Starter but if it was relevant to the operation of a page instance I would put it in the the page globals.

3) No
Thanks Agraham..
 
Upvote 0
Top