4GL Main table section

You use main table i/o sections to program actions that you want to be executed when read or write actions occur on the main table. These sections are not relevant to type 4 programs, as such programs do not have a main table. Main table i/o sections consist of a main section and a subsection. The main section is always main.table.io. The subsection indicates when the actions must be executed. 


Note that main.table.io sections (except the read.view subsection) are ignored when the corresponding DAL hooks are programmed in a DAL script.


Main section
main.table.io:
The subsections associated with this main section are executed either before or after input to or output from the main table. The main table for the current session is defined in the data dictionary. 


Subsections
before.read:
The actions programmed in this subsection are executed immediately before each read action on the main table.


after.read:
The actions programmed in this subsection are executed after each read action on the main table. You can use this subsection to call skip.io() in order to skip the record just read and to read the next record (if necessary). 


before.write:
The actions programmed in this subsection are executed before each write action on the main table. A write action occurs when a record is inserted. You can use this subsection to call skip.io() in order to undo the write action. 


after.write:
The actions programmed in this subsection are executed after each write action on the main table. A write action occurs when a record is inserted. You can use this subsection, for example, to write data to tables other than the main table. 


after.skip.write:
The actions programmed in this subsection are executed if a write action on the main table has been skipped as a result of actions programmed in the before.write subsection. The actions are executed immediately after the skip action. 


before.rewrite:
The actions programmed in this subsection are executed immediately before each rewrite of a record in the main table. A rewrite action occurs when a record is changed. You can use this subsection to call skip.io() in order to skip the rewrite action. 


after.rewrite:
The actions programmed in this subsection are executed after each rewrite action on the main table. A rewrite action occurs when a record is changed. 


after.skip.rewrite:
The actions programmed in this subsection are executed if a rewrite action on the main table has been skipped as a result of actions programmed in the before.rewrite subsection. The actions are executed immediately after the skip action. 


before.delete:
The actions programmed in this subsection are executed immediately before each delete action on the main table. You can use this section to call skip.io() in order to skip the delete action. 


after.delete:
The actions programmed in this subsection are executed immediately after each delete action on the main table. You can use this subsection, for example, for deleting references, if this is not done automatically. 


after.skip.delete:
The actions programmed in this subsection are executed if a delete action on the main table has been skipped as a result of actions programmed in the before.delete subsection. The actions are executed immediately after the skip action. 


read.view:
The actions programmed in this subsection are executed immediately after a view action on the main table (start.set, first.view, next.view, prev.view or last.view). You can use this subsection to call skip.io() in order to skip an entire set of records with the same value in the view fields.


Example
main.table.io:
before.delete:
if (not pctst099.del) then
skip.io("pctsts0001")
| cannot be deleted
endif
read.view:
if strip$(pctst099.cprj) = "" then
skip.io("")


endif


Related Post:

People who read this post also read :



0 comments:

Post a Comment

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More