Clearing all app activity and variables . . .
2020-10-12-182030
All --
I would like a way to clear out all of the activity of an APP.
It seems that I can unload the APP but that the variables that are created within the APP persist until the APP is EDITED in the PROJECT WORKBENCH
Thanks.
0
Best Answer
-
Hi Matt,
The short answer is no, there is no built-in way to return app to the initial state without unloading and loading the macro project.
Depending on where your variables are declared, they could be initialized at different steps. All variables defined in the Modules (e.g. Module1.vb) are initialized when the project is loaded. The variables that are defined in App or Form files (e.g. App1.vb) could be initialized when the app dialog shows app, when you click the app's icon on the Apps tab (in Me.Load event handler)
So, to initialize/reset all you variables when you or customer needs it you should create a "Reset" function and assign it to a button in your app. Many of our apps use that approach, here is how it's implemented in the Fiber Separation app:
Yuri0
Answers
-
Hi Matt,
If you want to go to the initial state of the app without unloading/loading of the app, you should create a "Reset" sub/function which sets proper initial values to all your variables (and could be called from the UI when you need it, assign a button to it).
It's similar to what we have in Image-Pro ribbon, like "Reset measurement options", "Reset classes",...
Yuri
0 -
2020-10-13-093702Yuri --Thank you for your suggestion.I think I did not make my self clear or I am not understanding some of the interaction of an APP and IMAGE-PRO.When we are editing an APP / PROJECT in the WORKBENCH, the character of the UI and the VARIABLES is suspended.When we LOAD an APP / PROJECT in the WORKBENCH, the APP / PROJECT is in a "CLEAN" INITIAL STATE determined only by CODE within and with no USER INTERACTION. When we then OPEN the APP via the APPS RIBBON, the relationship between IMAGE-PRO and the APP / PROJECT is in a RUNNING STATE and the VARIABLES and UI appear as set up in the CODE with no influence by the USER. When we CLOSE the APP / PROJECT, the relationship between IMAGE-PRO and the APP / PROJECT does not seem to return completely to the ""CLEAN" INITIAL STATE.Sometimes this is a good thing because the values of VARIABLES and the state of CONTROLS is not cleared automatically because the UI is CLOSED and a CLOSE / OPEN maintains VARIABLES and UI SETTINGS.Sometimes this is a bad thing because the values of VARIABLES and the state of CONTROLS is not cleared automatically because the UI is CLOSED and a CLOSE / OPEN maintains VARIABLES and UI SETTINGS and does not appear after a CLOSE / OPEN as they appear after a EDIT / LOAD / OPEN.Is there a way to return the APP / PROJECT to the "CLEAN" INITIAL STATE seen after EDIT / LOAD / OPEN as if it was never taken up to the RUNNING STATE?Thanks.-- Matt0
-
2020-10-13-181034Yuri --Thank you for the information and the suggestion.I will implement that.Thanks again.-- Matt
0
Categories
- All Categories
- 961 Image-Pro v9 and higher
- 9 Image-Pro FAQs
- 18 Image-Pro Download & Install
- 448 Image-Pro General Discussions
- 486 Image-Pro Automation (Macros, Apps, Reports)
- 20 AutoQuant Deconvolution
- 2 AutoQuant Download & Install
- 18 AutoQuant General Discussions
- 195 Image-Pro Plus v7 and lower
- 3 Image-Pro Plus Download & Install
- 106 Image-Pro Plus General Discussions
- 86 Image-Pro Plus Automation with Macros
- 19 Legacy Products
- 16 Image-Pro Premier 3D General Discussions
- 26 Image-Pro Insight General Discussions