Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 07 DEC 2007 09:01:56PM Aiden Massey wrote:

How can I trap the Esc key in a window. Trying to stop users from escaping from a window when a record has changed. I know users have to press Esc twice to escape but they may not be aware a process in the background has updated the record. Looking to display a more prominent message.

Arev 2.12


At 09 DEC 2007 06:11PM Support wrote:

Does $ESC.TO.EXIT work?


At 10 DEC 2007 10:40AM Victor Engel wrote:

You may want to take a look at this Sprezzatura article. Look particularly at references to WC_WC%

http://www.sprezzatura.com/revmedia/v4i9a1.htm


At 10 DEC 2007 12:25PM Dave Harmacek wrote:

Using Window Common you can compare the current record with the one read from the filing system. Then in the Pre-Save process of the window you can put up a message, or stop the save, or whatever.

The variables to compare are in Arev 2:

@RECORD

OREC

in Arev 3:

@RECORD

WC_OREC%

Dave


At 10 DEC 2007 12:29PM Victor Engel wrote:

The pre-save process does not execute when the user pressed ESC, so your idea will not work.


At 10 DEC 2007 02:25PM Aiden Massey wrote:

Reckon I stumped the experts. Decided to catch the prolem with a Post Application hook. @record and wc_orec% are still active so will compare the two to determine if the user escaped without saving. Window common variables are still active so I can still call pre and post save processes and then save the record.


At 10 DEC 2007 03:28PM Victor Engel wrote:

You can also query WC_WC% there as I suggested, to check if the ESC key was pressed, which is what I thought your point was.


At 12 DEC 2007 03:08PM Ralph Johler wrote:

When it is not a collector window, we use the POST-PROCESS WINDOW and compare @RECORD and wc_orec% to trigger the change without save warning. We often set wc_valid% to false so when certain changes have been made they MUST save.

For collectors, we use for simple windows setting in the Collector Save process a "C" code and it's command be @ANS=1.

In the program that calls the collector, set @ANS to 0 before calling the window and check it when returning from the window. If @ANS is 1, the user saved, else they didn't.

Otherwise the calling program can check @pseudo before and after the window.


At 13 DEC 2007 04:48PM Dave Harmacek wrote:

Actually, if a process has changed @RECORD why don't you just write the entire record, or the affected fields to disk? You already have it locked, don't you?

You can then stop the changed record message by setting Arev common OREC to the new values of @RECORD.

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/7da6b5f01ee0ec74852573ab000b29d4.txt
  • Last modified: 2023/12/28 07:39
  • by 127.0.0.1