Use the Section Editor
- Last Updated: October 13, 2023
- 3 minute read
- OpenEdge
- Version 13.0
- Documentation
Now you are ready to look at some of the code the AppBuilder has generated for you.
To view the code the AppBuilder created:
- Stop your window, and then click the Edit Code
icon in the main window:
The Section Editor appears. This is where you examine and write all your ABL code when you are using the AppBuilder. If you drop down the Section list, you see that there are five types of sections the Section Editor maintains for you:- Definitions — A section at the top of your procedure where you can write variable definitions and other statements that are needed by the whole procedure.
- Triggers — Blocks of code that execute when an event occurs (for example, when a user clicks a button). You write some triggers of your own just ahead.
- Main Block — The part of the ABL code that is executed as soon as the procedure starts up. You will look at the main block of this sample procedure below and see what it does for you.
- Procedures — Internal procedures, exactly like the one you wrote in “Run ABL Procedures.”
- Functions — User-defined functions are like internal procedures, but they return a value to the statement that uses them, just as the built-in ABL functions you used in “Use Basic ABL Constructs” do.
- Select Procedures from the list of section types:
- From the list of internal procedures (the Name drop-down
list), select enable_UI:
The AppBuilder generates this code to get your window started. This code does all the things that make the window, and then the data, appear.
Note that the AppBuilder has generated the header statement PROCEDURE
enable_UI for you, but does not show it except to show the procedure name.
Also note that the procedure is marked Read-Only. That is because
the AppBuilder created it and does not want you to make any changes to it directly. If
you change any objects in the design window, it changes the code for you.
When you create new procedures of your own, you can edit them in the Section Editor just as you did in the Procedure Editor.
Next you take a look at this code to see what it is doing for you. A word of warning before you start: Because this is AppBuilder-generated code, some of it is not as readable as it might be if you wrote it by hand. The whole idea is that you almost never need to look at this code. But you are going to do that here so that you understand what is going on behind the scenes.