Progress
AppBuilder
Developer’s Guide
Access Section (adeuib/_accsect.p)
Use the
adeuib/_accsect.p
procedure to read and write code sections in AppBuilder:
Input Parameters
The
adeuib/_accsect.p
procedure takes the following input parameters:pc_mode
A quoted character string that specifies the mode of operation. Valid values are:
- “GET”— Reads the contents of the section or returns unknown (?).
- “SET”— Writes the contents of the section.
- “DELETE”— Deletes the current section.
You cannot actually delete either the MAIN-CODE-BLOCK or the DEFINITIONS sections (see pc_section below). The DELETE value empties the section but does not also remove the stub.
pi_context
The context ID of the object to access. If unknown (?), AppBuilder assumes the current window or procedure.
pc_section
The name of the code section to access. Valid values are:
- DEFINITIONS
- MAIN-CODE-BLOCK
- TRIGGER:event-name
(For example, TRIGGER:CHOOSE)- PROCEDURE:name:handler
(For example, PROCEDURE:mytest:maintain.p. See the “Examples” section below for a description of how you can use this.)- FUNCTION:name
- XFTR:xftr-name
When you have a TRIGGER, then pi_context refers to a widget. In all other cases, pi_context points to the procedure.
If pi_srecid is unknown (?), then pi_context and pc_section are used to identify an existing section. If pi_srecid is known, then pc_section is ignored.
Input-Output Parameters
The
adeuib/_accsect.p
procedure uses the following INPUT-OUTPUT parameters:pi_srecid
The context ID of the current section. If its value is other than unknown, pc_section is ignored.
pc_code
The contents of the trigger or other code section.
Return Values
This procedure returns:
“Error”
Indicates that pi_context is not specified and there is no current procedure or window.
Examples
The following code resets the MAIN-CODE-BLOCK to an include file:
The following example creates a AppBuilder-maintained procedure: a procedure that the Code Section Editor displays as a READ-ONLY procedure. The following code fragment calls
adeuib/_accsect.p
:
In this example:
- The first INPUT parameter, “SET”:U, specifies SET mode; SET mode tells
adeuib/_accsect.p
to write or create a code section.- The second INPUT parameter, ?, specifies the context ID of the object to access. By default,
adeuib/_accsect.p
interprets the unknown value (?) to be the context ID of the current window or procedure.- The third INPUT parameter, “PROCEDURE:mytest:maintain.p”, specifies the following:
- The first INPUT-OUTPUT parameter specifies the context ID of the section; this value must be unknown (?) or pc_section is ignored.
- The final INPUT-OUTPUT parameter is a character string that holds the contents of the section.
This
maintain.p
procedure generates the code for the mytest internal procedure:
The
maintain.p
procedure generates a mytest procedure that the Code Section Editor displays as read only. Here are the contents of the generated mytest procedure:
AppBuilder-maintained Procedures provide an alternative to traditional XFTRs. They basically fill the role of an XFTR with only a single WRITE handler. The advantages of AppBuilder-maintained procedures over XFTRs are:
Their disadvantages are:
- They can be deleted by the user from the Code Section Editor menu (Edit/Delete Procedure).
- They cannot store data in comments used to rebuild the code section. That is, the contents of the AppBuilder-maintained procedure must be derived totally from external sources or calls to
adeuib/_uibinfo.p
. For example, an XFTR handler can read a section and have it affect what it generates; however, an AppBuilder-maintained procedure can only write code.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |