A AFSSoftware Member Licensed User Longtime User Nov 7, 2011 #1 Hi, I have make a widget with an Service Module. After click at Widget i want start my Main Module and execute an Sub. How it works? I try Application.Run: Sub ImageView_wid_Click Application.Run "Main.my_sub" End Sub But it reports: Error parsing program. Error description: Undeclared variable 'application' is used before it was assigned any value. Occurred on line: 28 Application.Run "Main.my_sub"
Hi, I have make a widget with an Service Module. After click at Widget i want start my Main Module and execute an Sub. How it works? I try Application.Run: Sub ImageView_wid_Click Application.Run "Main.my_sub" End Sub But it reports: Error parsing program. Error description: Undeclared variable 'application' is used before it was assigned any value. Occurred on line: 28 Application.Run "Main.my_sub"
Erel B4X founder Staff member Licensed User Longtime User Nov 7, 2011 #2 There is no such method / object named Application. You can start an Activity by calling StartActivity(Main). You can call a sub with CallSub. However you will only be able to call an activity sub after it is started. Usually you will want to set the value of a Process Global variable and then in Activity_Resume you should test the variable value and act accordingly. Upvote 0
There is no such method / object named Application. You can start an Activity by calling StartActivity(Main). You can call a sub with CallSub. However you will only be able to call an activity sub after it is started. Usually you will want to set the value of a Process Global variable and then in Activity_Resume you should test the variable value and act accordingly.