


A control must be activated to allow data to be entered into it by the user. Once a control is activated, it usually operates on its own without any additional programming. After the user finishes with the control, any associated COBOL data item is updated with the modified value. Only one control can be active at any given time.
To activate a control, use the ACCEPT verb. If you ACCEPT a single control, that control is activated, and the user can interact with it until some terminating event occurs (usually pressing a termination or exception key, or selecting some other control with the mouse). Once the entry is terminated, the affected data items are updated and the ACCEPT statement terminates.
If you ACCEPT a Screen Section entry that contains several controls, the runtime allows the user to move between those controls, activating each as necessary. This simplifies the process of managing a set of controls on the screen because you do not need to process various mouse and keyboard requests in your program. For this reason, it is generally preferable to use the Screen Section for graphical controls. Ideally, all of the controls contained in any one window should be contained in a single Screen Section entry. When this is the case, you can allow the user to enter data into the entire window with a single ACCEPT statement. You can use the Screen Section's embedded procedures to perform any necessary processing, such as validating data entry, at the same time that the user is interacting with the screen (see section 6.5.5, Book 1, "User's Guide").