G G.Z. Member Oct 20, 2016 #1 Hello, I'm trying to play with the HelloWorld example and I need to share a variable from all module. I wrote this (in Main) Sub Process_Globals Public StartBus As Int = 0 End Sub (in HelloWorld) Sub btnCalc_Click (Params As Map) StartBus = 1 End Sub In the module HelloWorld I want to set StartBus = 1 to start a proces tha is running in Main (timer) The problem is in the HelloWorld module the variable StartBus seem undeclared and setting it to 1 dont let start other process. Any suggestion pls.? Thanks
Hello, I'm trying to play with the HelloWorld example and I need to share a variable from all module. I wrote this (in Main) Sub Process_Globals Public StartBus As Int = 0 End Sub (in HelloWorld) Sub btnCalc_Click (Params As Map) StartBus = 1 End Sub In the module HelloWorld I want to set StartBus = 1 to start a proces tha is running in Main (timer) The problem is in the HelloWorld module the variable StartBus seem undeclared and setting it to 1 dont let start other process. Any suggestion pls.? Thanks
I inakigarm Well-Known Member Licensed User Longtime User Oct 20, 2016 #2 You've to reference the Module from you're declaring the variable (in this case, Main); so, in Module HelloWorld, set (or get) the variable with: Code: Copy Main.Startbus=1 Upvote 0
You've to reference the Module from you're declaring the variable (in this case, Main); so, in Module HelloWorld, set (or get) the variable with: Code: Copy Main.Startbus=1