Progress
Language Tutorial
for Windows
Procedure Block
Every procedure includes a procedure block, whether the procedure is a main procedure or an external or internal subprocedure. The procedure block encompasses the entire procedure file (a .p file). You can include any Progress 4GL statement inside the procedure block, and you can also nest other blocks inside the main procedure block. However, the main procedure block cannot be enclosed in another block. The procedure block does not have a block header statement—Progress automatically starts a new procedure block when you run a new procedure file. The procedure block does not require or allow an END statement to terminate it—the end of the procedure file marks the end of the procedure block.
Quite literally, the procedure block encompasses all the code in a procedure file. However, only the statements that are not part of another block belong to the procedure block. The procedure block is also characterized by these features:
A typical event-driven procedure contains definitions, triggers, and main logic. The task of blocking the interface with the WAIT-FOR statement usually falls to the procedure block, because it is the outermost block. Blocks within the procedure block normally work with the interface created and blocked for input in the procedure block.
The procedure block has implicit frame allocation, that is, any screen I/O statements in the procedure block that do not explicitly use a defined frame perform their functions in a default frame owned by the procedure block.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |