EODEXIT(0) & Mandatory fields
Posted 11 December 2002 - 06:41 AM
More with mandatory fields.....
I have a screen with 5 input-able fields and field 3 is a mandatory input field.
I have a button that is assigned to run a logic that just does an EODEXIT(0).
EODEXIT(0) is supposed to exit the LS, doing all file writes but it is supposed to ignore mandatory input checks.
This works fine, unless the current field you are on before you press my button is a mandatory input field. Then the mandatory check is done, and you cant exit the screen using the button.
Any bright ideas on how to get around this one, anyone? (A generic solution, like the ForceWrite command is what I need... or maybe this is a bug that needs to be fixed for EODEXIT?)
Posted 11 December 2002 - 10:01 AM
Sorry if this sounds dumb, unused as I am to using
the GUI, but what is the screen mode and Last Read Field?
Setting the LRF to a field before the MI one might
bw worth a try?
of the poster and do not represent those of any organisation.
Posted 11 December 2002 - 07:20 PM
The demo function is incorrect, the documentation describes the behaviour of EODEXIT correctly.
EODEXIT(0) is the same as FLD(999)
FLD(999) was introduced into 4.6 and it is a way of skipping all subsequent fields, the intention being to get to the write on the record. It is correct then that this hits Mandatory Input check if the field you are on is mandatory and null - it would be the same as trying to fld jump forward off it in a button click logic.
EODEXIT(1) primarly does an F3 keypress. Again the intention really is to commit the record. After the write part of the timing cycle has finished it then exits the LS.
This can be used to write a paging screen record and then exit the paging screen, or similarly, exit a many-time screen.
The reason it does not stop when on the empty first MI field in the demo is that the cursor's on our friend the primary field!
The EODEXIT(1) issued by the button click does the 'F3' keypress behind the scenes, which because the field has no input the 'no data write' optimisation kicks in....
If ForceWrite() had been issued against the cycle then it would not do this optimisation and exit, and you'd get a MI error. You can check this by populating field 1 in the demo and try clicking the 'Ignore MI' button on field 2: it errors with MI field.
Out of interest, Rob, why would you not want a mandatory field to be populated, but still want to do the file writes? Without knowing what you're trying to achieve, doesn't it suggest the field shouldn't be mandatory?
Don't learn from your own mistakes - it's safer and more entertaining to learn from the mistakes of others!
Just because you can, it doesn't mean you should!
Reply to this topic
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users