Skip to main content

I have a program in cobol wow that is called to create a file. The main program only does the following: perform process-1 thru exit-process-1. The process involves reading a file to finish creating other new features. While running the process "read next" I want to allow the user to press a button to cancel.
On the form I have a button that says "press here to cancel". During the process I need to know if the user presses the button to cancel. The question is, what code should I include in the process for detecting that was pressed the button "cancel" and proceed to go to the exit-process-1.

I have a program in cobol wow that is called to create a file. The main program only does the following: perform process-1 thru exit-process-1. The process involves reading a file to finish creating other new features. While running the process "read next" I want to allow the user to press a button to cancel.
On the form I have a button that says "press here to cancel". During the process I need to know if the user presses the button to cancel. The question is, what code should I include in the process for detecting that was pressed the button "cancel" and proceed to go to the exit-process-1.

See the WOW help file topic Event-Handling Code Dialog Box.  Add event handling logic that sets a flag that the button was presses.

There are a lot of examples in WOW, so you should be able to find something that is applicable.


I have a program in cobol wow that is called to create a file. The main program only does the following: perform process-1 thru exit-process-1. The process involves reading a file to finish creating other new features. While running the process "read next" I want to allow the user to press a button to cancel.
On the form I have a button that says "press here to cancel". During the process I need to know if the user presses the button to cancel. The question is, what code should I include in the process for detecting that was pressed the button "cancel" and proceed to go to the exit-process-1.

Hi.

I am using CALL SENDMESSAGE USING WIN-RETURN option1-H BM-GETCHECK to get the status 0 or 1 but when the program go into the process "perform proceso-1 thru exit-proceso-1" I ask if WIN-RETURN = 1 because on event click I send CALL SENDMESSAGE USING WIN-RETURN option1-H BM-SETCHECK 1.

The problem is that there is no communication between the form when the cancel button is pressed while the program is reading the file and creating records. While the program reads each record I use SendMessage instruction CALL USING WIN-RETURN option1-H BM-GetCheck to get the value of the variable in WIN-RETURN. If I press the button to cancel the value of WIN-RETURN must change from 0-1 but while the process of reading the file cobol not aware of what happens in the form runs.