4GL Event Section

A 4GL script can contain one or more of the following types of sections:
With the exception of program sections, each section consists of a main section and one or more subsections. A main section indicates the object for which the programmed actions must be executed. A subsection specifies when the actions must be executed. Program sections consist of a main section only.
If you do not include a main section immediately before a subsection, the subsection is assigned to the previous main section in the script. For example:


form.1: | main section 
init.form: | subsection executed for form 1
...
...
before.form: | subsection executed for form 1
...
...
after.form: | subsection executed for form 1


...
The following rules apply to the ordering of sections within a script:
  • The declaration section must be the first section in the script.
  • The functions section must be the last section in the script. 
  • Other sections can occur in any order, but the preferred order is: program sections, form sections, group sections, choice sections, field sections, zoom sections, main table sections.
  • Do not mix sections of different types. For example, do not define a choice section, followed by a field section, and then a choice section again. Exceptions are the declaration and functions sections, which must be the first and last sections respectively in the script.
Variables declared in the declaration section are global variables that you can use in other sections. Variables declared within any other section are local variables that you can use in that section only.

People who read this post also read :



0 comments:

Post a Comment

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More