Using POINTs and BLOCKs
POINT and BLOCK sections are the areas in the generated
code where you can add your own code.
Any code added in a POINT or BLOCK is
preserved in the application even when the application is rebuilt.
POINT or BLOCK section is
preserved in a .code file that is used each time the application is compiled.
If you are using Source Code Management, the .code file must be committed
with the project. It is not necessary to commit the generated 4gl files. POINT
POINT sections are located within each function
BLOCK. The more granular POINT sections are
located in all relevant locations for adding business logic such as in all control
blocks (BEFORE ROW, AFTER INPUT, ....). Common
uses of a POINT include defining your own variables, setting
conditions on SELECT statements, adding or modifying actions in
control blocks of interactive dialogs such as CONSTRUCT,
INPUT, MENU, and changing the program flow.
POINT.
| Description | POINT name | Example |
|---|---|---|
| Import an additional module(s). | import |
|
| Add comments in the code. | comment |
|
| Define modular scope variables. | define |
|
| Define local scope variables. | function.define |
|
| Add additional function(s) to the module. | user.functions |
|
Add additional actions for each of the interactive dialog
statements (DISPLAY, DISPLAY
ARRAY, CONSTRUCT,
INPUT, INPUT
ARRAY and MENU). |
userControlBlocks |
|
BLOCK
BLOCK section. BLOCK, you take responsibility for the validity of all the code in that
BLOCK.Status attribute
POINT and BLOCK
sections will only contain
the Name attribute.{<POINT Name="fct.uiDisplay.dlg.userControlBlocks">}{</POINT>}When
the code is changed, the POINT and BLOCK will
include a Status attribute set to
MODIFIED.{<POINT Name="fct.uiDisplay.dlg.userControlBlocks" Status="MODIFIED">}
ON ACTION test
MESSAGE "testing..." {
</POINT>}