The Definitions section
- Last Updated: December 20, 2023
- 2 minute read
- OpenEdge
- Version 13.0
- Documentation
The top of the procedure file is the Definitions section. This section
starts out as an empty template. It provides a space where you can enter documentation
information about your procedure. You can access this section by selecting it as the
Section type in the Section Editor, as
shown:
It is a good practice to fill this section in and keep it up to date.
There is just one statement generated for you in this section: CREATE
WIDGET-POOL. Objects that make up an application are sometimes called
widgets. ABL uses widget pools to provide memory management for all of the objects that
are created in a procedure, including the frames, fields, and buttons in your window as
well as some data management objects such as queries. This statement gives you an
unnamed widget pool for everything in the procedure. When the procedure finishes
executing, all of the memory its objects use is released. This is a good default, but
when you get to more advanced programming, you learn how to create named widget pools
that have a lifetime you define for them. For the most part you do not have to worry
about them.
Below the CREATE WIDGET-POOL statement is an area where you can define
variables and parameters for your procedure. These variables are scoped to the external
procedure. That is, any variables you define here are available for use throughout the
procedure file, including any internal procedures it contains. You learn a lot more
about scoping in Procedure Blocks and Data Access.
Continuing your look through the Code Preview or printed listing,
the next section of the file has all the Preprocessor
Definitions the AppBuilder uses to define queries, field lists, and
other syntax that can be used in other AppBuilder-generated code throughout the
procedure. You saw this before and looked at a few specific definitions in Look at preprocessor values in the Code Preview.