F Fernando Pessoa Member Apr 12, 2020 #1 I'm creating a very simple android app. I have the Main Module and Resultado Module In Main Module I declared a Public variable called numeroescolhido When I try to assign its value to a label in Resultado Module it is not accepted. What elsa must I do to get and use the value of that Public variable? I read and I watch videos, but I couldn't find out what I am doing wrong. Thanks in advance for any help in this subject
I'm creating a very simple android app. I have the Main Module and Resultado Module In Main Module I declared a Public variable called numeroescolhido When I try to assign its value to a label in Resultado Module it is not accepted. What elsa must I do to get and use the value of that Public variable? I read and I watch videos, but I couldn't find out what I am doing wrong. Thanks in advance for any help in this subject
Erel B4X founder Staff member Licensed User Longtime User Apr 13, 2020 #2 This is explained in the videos and in the guides. Views must be declared in Globals sub and they cannot be accessed from outside of the activity code. Upvote 0
This is explained in the videos and in the guides. Views must be declared in Globals sub and they cannot be accessed from outside of the activity code.
klaus Expert Licensed User Longtime User Apr 13, 2020 #3 When you declare a variable, like your numeroescolhido , as Public in Process_Globals in the Main module. Then you can access it in other modules with Main.numeroescolhido. You must add the module name as a prefix. This is explained in the B4X Basic Language booklet page 19. Upvote 0
When you declare a variable, like your numeroescolhido , as Public in Process_Globals in the Main module. Then you can access it in other modules with Main.numeroescolhido. You must add the module name as a prefix. This is explained in the B4X Basic Language booklet page 19.
F Fernando Pessoa Member Apr 13, 2020 #4 Thank you Klaus and Erel for your help. It's working as Klaus said, and Iwill go to read the articles you brought to my attention. I searched the net, but I couldn't find out any usefull tip regardind this subject. Once more, thank you both. Upvote 0
Thank you Klaus and Erel for your help. It's working as Klaus said, and Iwill go to read the articles you brought to my attention. I searched the net, but I couldn't find out any usefull tip regardind this subject. Once more, thank you both.