Most of this logic is stored in a resource file (.wfm file), and often all you will see in the code procedure (the .MNT or MAINTAIN file) related to your form is Winform Show. At compile-time, both the .MNT code and the .wfm resource code are built into a run-time procedure (the .FCM, or FOCCOMP file). The actual Maintain code that retrieves or updates data from a database and manipulates that data (or any other non-form logic) should not be implemented in this procedure. These Maintain database commands should be implemented in different procedures that are called or execed from this presentation logic procedure.
The presentation logic procedure must follow the rules of the Maintain compiler and run-time environment. It must have a beginning and end, and any data structures referenced in the form logic or in the CALL or EXEC parameter lists must be described and initialized. In the following presentation logic example, the Getdata and Putdata database logic procedures have the same MAINTAIN FILE MOVIES starting syntax and the same Infer command:
MAINTAIN FILE MOVIES Infer moviestk from movies
Case Top Winform_Show EndCase
Case GetData CALL getdata from moviestk into moviestk EndCase
Case PutData CALL putdata from moviestk into moviestk EndCase
Presentation logic procedures are always invoked by the submit request of a browser, through WebFOCUS Maintain. All other procedure types are invoked by CALL or EXEC commands from a running Maintain procedure.