Update to Article.
In practical use you might stumble upon the problem of DataEase not being active when the timer runs out. To resolve this read on:
DataEase has a big divide between GUI functions and PRISM functions.
GUI functions are called in the Windows GUI bit of the product and is basically WINDOWS stuff like DocumentOpen, ExitDataEase, SetValue, SetState etc.
PRISM functions are DataEase DNA and is functions that work on the data like concat,firstc, abs,random etc.
PRISM functions will always work but GUI functions is processed by the ACTIVE document!!
This is a new concept for most DataEase users that are used to sequential processing (PRISM and DFD etc).
DFW will go quite far in fooling you into believing that it is sequential too but it isnt. It is all based around the Windows Message bus.
ALL GUI functions are sent as messages to active window and with luck you will 99.99% of the time up to 8.5 send that to the document from where they are called.
But the more advanced user would have tried something like this.
What you want to achieve here is obviously to open a new document and close the one you are currently calling from…
But you then to your big surprise find that ex. Nothing happens, or you see the new document open to quickly close again.
This is because you open a new document that then become the active document and then the message you have sent to the bus in reality only tell DataEase to close the active document, not the document you thought you wanted to close.
But this goes further. Because Active Document (or in reality Active Window) is not a DataEase thing but a Windows thing. You can only have 1 ONE Active document on your computer, so when you switch over to Word there is NO active document in DataEase and hence nothing can be executed in GUI!
And this lead us on to your problem.
You have only seen the problem when user minimize or lock DataEase but in reality the problem is the same if he is working in word. ExitDataEase(Silent) is a GUI function and need an Active Active Document in DataEase to be executed in.
Luckily for you we use our own product and features so when realising this we made a function to activate DataEase.
it is called
SetCurrent("ActivateDE") -- Activate DE environment for GUI updating.
And for those of you that want to take it one step further and control which Window/Document is active in your DE you also have
SetCurrent("ActiveDoc","DocumentName") -- Bring to front and activate Document
So the simple modification for you script to make it work 100 out of 100 times is
define "retval" text .
define "mytime" time .
define "timeleft" number .
if getvar("KillTimer") not =blank then
myTime := GetVar("KillTimer") .
timeleft := mytime - current time .
if mytime = current time then
retval := SetCurrent(ActivateDE)+ExitDataEase("silent") .