$04 Suppressing OK message

Kelly Burgess kellyb at montana.com
Fri Jun 17 04:26:59 EDT 2016


Hi Ben,

>I tried to substitute load event handler instead of load error handler but with no success.

To be expected.  Studio event handlers are externals, so that command to Load event handler went looking for an external named for your code class and method, and it failed to find anything to load.  The Unload event handler command would also find nothing to unload.  Load error handler and Unload error handler are the ones that take a code class method name as a parameter.

But an error handler method would not be called when a method elsewhere in your code runs the OK message command.  The OK message command is very modal, and it blocks when it executes, so nothing else gets any events until you click OK to dismiss the dialog.   So you can't hope to see a discardable event in any handlers when OK message executes.

The proper way to conditionally suppress OK messages in your own code would be to use an optional pRunSilent boolean parameter, defaulting to false, but from your automated processing code you would pass true, and use that to skip over any OK message commands in your code.

Kelly




More information about the omnisdev-en mailing list