Checking PF-Key rules before field format checks.

Is it possible to process the rules I have for a couple of PF-Keys (specifically my Cancel and Reset ones), before the map checks to see
what what is entered in the field is the proper format? My problem is that I have several N6.5 fields, and if the user enters a
1111111 (or whatever), the map will force them to correct it, rather than letting them Exit or reset the values.


The only way to do this would be to make the map field an alpha field. Then you can test for a valid value in the processing rule:


There are simple (maybe) ways to handle both your needs.

The “maybe” is that both require PA keys, not PF keys.

The difference is that PA keys are acted upon before data is transferred from the screen, while PF keys transfer data before acting on the key.

There is a little known Natural “goodie”, %R. If you equate this Terminal Command to a PA key, you now have a RESET of all the screen values.

Why is this so good? You can have a PA key set to %R, with, of course, suitable instructions on the map how to invoke a PA key (may be necessary depending on the terminal emulator you use).

The user accidently re-enters a set of data they have already processed. All the user has to do is hit the appropriate PA key before hitting either enter or a PF key, and presto, the screen is back to the way it was when first displayed.

Now for the Cancel (which I presume is escape back to the program) function.

In your program make a PA key program sensitive, say PA3.

In the PF key processing rule in the Map, code:

IF *PF-KEY = ‘PA3’

Now run the program; enter 11111 into an N2.2 field; hit PA3; you will be back in your program.


Just a note. The above assumes the user knows they want to RESET or Cancel.

If you try have a PF key rule and test say PA3, then try to test an entered value (ala Daniel’s suggestion) it will NOT work, since the screen values will not have been entered as yet.

So, you would have to use a PF key rule for a PF key if you want to test a field for a valid numeric value. You could have text in a REINPUT statement to tell the user about the PA keys for RESET or Cancel.

The %R is still a valid way to let the user RESET a screen if they know they want to do a RESET.