Post Reply 
Where can I place a code in app’s program, which will be executed just once?
09-14-2016, 03:07 PM
Post: #2
RE: Where can I place a code in app’s program, which will be executed just once?
To have the initialized on app load, you'll want to put code in the application "Start".

VIEW "Start",START()

Note that this will be executed on every application load - if the user starts the app programmatically, switches to another then back, etc. If you need to avoid it for certain circumstances, maybe combining with part 2 below would be helpful.

For the second, I'd probably recommend an app program global variable that you can set and then check in your VIEW code. This would be a variable in your app scope, but not exported to help avoid it being messed with. It would be set when compiling/installing the app for the first time.

<...program file start...>

DiasableView1:=0;

VIEW "Plot",START()
BEGIN
if(DisableView1) then ...
else ... end
END;

That might work to accomplish what you are thinking.

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Where can I place a code in app’s program, which will be executed just once? - Tim Wessman - 09-14-2016 03:07 PM



User(s) browsing this thread: 1 Guest(s)