%StandardAcceptedHandling #GROUP  

Top  Previous  Next

This #GROUP generates all the code to handle field-specific events for the procedure. It generates its code inside the Window Template's CASE FIELD() structure.




 #MESSAGE('Control Handling: ' & %Control,3)


#?OF %Control

 #EMBED(%ControlPreEventHandling,'Control Event Handling, before generated code') %|



 #EMBED(%ControlEventHandling,'Internal Control Event Handling')  %|


 #EMBED(%ControlPostEventHandling,'Control Event Handling, after generated code') %|





This code starts with the #FOR(%Control),WHERE(%ControlMenu) statement. The WHERE attribute limits this #FOR loop to only those instances of %Control that contain menu items. The #FIX statement ensure that this code only deals with Accepted events.

The #MESSAGE statement displays its message during source generation. #SUSPEND begins a conditional source generation section.

The #?OF %Control statement conditionally generates an OF clause to the CASE ACCEPTED() structure for the currently processing instance of %Control. This line of code, since it is prefaced with #?, will only generate if there is some other code generated within it, eliminating an empty OF clause.

All three #EMBED statements have ",%Control,%ControlEvent" appended to the end, so the programmer will have a separate embed point available for every instance of the %ControlEvent symbol within every instance of the %Control symbol. For this group, this only means the Accepted event.

The #INSERT(%FieldTemplateStandardHandling) statement generates code to handle all the Actions dialog selections the programmer has made for the menu item. The next two #EMBED statements also have ",%Control,%ControlEvent" appended to the end. The first has the HIDE attribute, so it is available only for Code, Control, and Extension template use. These three #EMBEDs give the programmer an embed point both before and after any code automatically generated for them by the Actions tab prompts.

#RESUME terminates this #SUSPEND section. #ENDFOR terminates the %Control loop.