SAVEWARN (OpenInsight 32-Bit)
At 05 APR 2011 01:52:09PM David Nicol wrote:
I want to remove the SAVEWARN message on a form when someone clicks the red X on the top right corner of the form. I have looked but cannot find how to trap that. I was able to program the Cancel button that I put on the form and also the Close under the File menu. Can anyone point me in the right direction?
At 06 APR 2011 05:40AM [email protected] wrote:
David,
If you want to trap the SAVEWARN message the best place to do this in the SYSMSG event, but you'll need to do this in an event script so you get it before the system does.
Basically you set an argument to fool the system into thinking the "No" button was clicked and stop the event chain like so:
0001 /* 0002 Sample SYSMSG event handler to suppress the SAVEWARN 0003 message and return a "No" result 0004 0005 SYSMSG has three parameters: 0006 0007 msgCode 0008 cancelFlag 0009 statCode 0010 0011 */ 0012 $insert ps_Equates 0013 retVal = TRUE$ 0014 0015 begin case 0016 case ( msgCode = SYSMSG_SAVEWARN$ ) 0017 cancelFlag = 2 ; * // Return "No" to the system 0018 retVal = FALSE$ ; * // Stop the event chain 0019 ; * // to supress the message 0020 0021 end case 0022 0023 return retValDoing it this way your solution is centralised and you won't need code on the menu and buttons to handle it.
Battlestar Sprezzatura - BSG 77
Colonial leaders in all things RevSoft
At 06 APR 2011 02:35PM David Nicol wrote:
Thank you Captain. However your code is missing equates for TRUE$ and FALSE$ unless I don't know that there is a way to set those globally.
At 06 APR 2011 03:05PM Erik Smith wrote:
David,
Place this in your codeā¦
Equ True$ To 1
Equ False$ to 0
Thanks,
Erik
At 06 APR 2011 08:07PM Richard Bright wrote:
Could always do
$Insert Logical