If a procedure takes a long time to run, say a couple of seconds or more, it is sometimes possible that the procedure will malfunction if the user clicks on a different window, especially if the window belongs to a different database than the one running the procedure. For users in an office environment, where users vary in skill and experience, it would be valuable to be able to control this problem.
Gary Yonaites suggested a method for doing this in an earlier post: open a dialog with the opendialog statement, which will disable the effect of mouseclicks while the dialog is open, but will allow the procedure to continue running. When the procedure completes the portion that runs in the background, the dialog is closed.
I wonder whether Panorama should provide a statement to disable mouseclicks, then re-enable mouseclicks, to use during a procedure. In the meantime, I have started using the following procedure, which I have added as a custom statement called PleaseWait. The statement has one parameter: the message that the dialog will display. I wonder if others have dealt this issue and what others think about this.
fileglobal fgpwmessage fgpwmessage=parameter(1) TryAgain: try opendialog "PleaseWait","closeable","no","TitleBar","no" fixwindow zoomalign "top" catch Alertsheet "Adding a form, just this once...." shortcall GT goto TryAgain endcatch rtn GT: [add code to create the 'PleaseWait' form in case it is not installed.] rtn
You must follow this statement with a closewindow statement because otherwise you will not be able to do anything and would need to do a Force Quit. Has anyone dealt with this issue?