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
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