Skip to main content

[Migrated content. Thread originally posted on 03 October 2003]

Is there any way to exit the screen currently being accepted from within an after procedure? Any approach that will not cause a before procedure will be useful.

Merlin

[Migrated content. Thread originally posted on 03 October 2003]

Is there any way to exit the screen currently being accepted from within an after procedure? Any approach that will not cause a before procedure will be useful.

Merlin
Check out ACUCOBOL-GT documentation:

Book 3. Special-Names Paragraph.
General Rules - Screen Control Entry

The clue er is what in this chapter is referred to as
ACCEPT-CONTROL by modifying this value you are able to control in and out action of the your screen section entry.

[Migrated content. Thread originally posted on 03 October 2003]

Is there any way to exit the screen currently being accepted from within an after procedure? Any approach that will not cause a before procedure will be useful.

Merlin
Check out ACUCOBOL-GT documentation:

Book 3. Special-Names Paragraph.
General Rules - Screen Control Entry

The clue er is what in this chapter is referred to as
ACCEPT-CONTROL by modifying this value you are able to control in and out action of the your screen section entry.

[Migrated content. Thread originally posted on 03 October 2003]

Is there any way to exit the screen currently being accepted from within an after procedure? Any approach that will not cause a before procedure will be useful.

Merlin
Setting GotoField to true will cause the accept not to terminate inside an exception procedure. However, setting GotoField to false will not cause the accept to terminate inside an after procedure. This would be ideal if it worked. Is there a value I can set Accept-Control to that will cause the screen to terminate?

I need a graceful action that causes the accept to terminate from an after procedure based on a condition. Currently I do that by echoing an escape key with w$keybuf, but this causes undesirable affects because the next field's before procedure is fired before exiting. Surely there must be a better way?

Merlin

[Migrated content. Thread originally posted on 03 October 2003]

Is there any way to exit the screen currently being accepted from within an after procedure? Any approach that will not cause a before procedure will be useful.

Merlin
On a whim following your email I set Accept-Control to 3 inside the after procedure. Contrary to my expectations, this termiated the accept like I wanted. This is extremely helpful. I would like to point out, though, that this behavior is not documented. However, I credit you for helping me with the problem.

Thanks,
Merlin

[Migrated content. Thread originally posted on 03 October 2003]

Is there any way to exit the screen currently being accepted from within an after procedure? Any approach that will not cause a before procedure will be useful.

Merlin
It IS documented.
However, I can agree with you that it is not blaring into your eyes... :-)

If you look into the help page I referred you to, scroll down to the paragraph with the bullet 4, sub section c).

It says:

If ACCEPT-CONTROL is 2, the ACCEPT statement terminates normally. The value of CONTROL-VALUE determines the termination value of the ACCEPT statement. You can determine its value by examining CRT STATUS or by using the ACCEPT FROM ESCAPE KEY verb.

If you set ACCEPT-CONTROL to 3, which you use, the behavior you get is described in sub section d):

If ACCEPT-CONTROL is 3, the ACCEPT statement terminates with an exception, assuming that exceptions are allowed. The value of CONTROL-VALUE sets the exception value of the ACCEPT statement. You may use CRT STATUS or the ACCEPT FROM ESCAPE KEY verb to determine the statement's exception value.

Gisle

[Migrated content. Thread originally posted on 03 October 2003]

Is there any way to exit the screen currently being accepted from within an after procedure? Any approach that will not cause a before procedure will be useful.

Merlin
It IS documented.
However, I can agree with you that it is not blaring into your eyes... :-)

If you look into the help page I referred you to, scroll down to the paragraph with the bullet 4, sub section c).

It says:

If ACCEPT-CONTROL is 2, the ACCEPT statement terminates normally. The value of CONTROL-VALUE determines the termination value of the ACCEPT statement. You can determine its value by examining CRT STATUS or by using the ACCEPT FROM ESCAPE KEY verb.

If you set ACCEPT-CONTROL to 3, which you use, the behavior you get is described in sub section d):

If ACCEPT-CONTROL is 3, the ACCEPT statement terminates with an exception, assuming that exceptions are allowed. The value of CONTROL-VALUE sets the exception value of the ACCEPT statement. You may use CRT STATUS or the ACCEPT FROM ESCAPE KEY verb to determine the statement's exception value.

Gisle