General lay-out rules script agents and script libraries
Attribute(s)
General Lay-out
Description
All script agents and script libraries must conform to the general lay-out rules as described in the Details field.
Motivation
Adhering to a standard general lay-out for scripts will allow for easier maintenance and troubleshooting.
Example / Details
Lotus Notes automatically formats LotusScript code. There are, however, a number of conventions which, if followed, lead to a more efficient running script, fewer errors, and easier maintenance and troubleshooting. All script agents and script libraries must be built in the following manner: The following order of sections must be followed in all script agents and script libraries:
Code documentation
Standard declarations/ settings.
Declaration of all module specific variables.
Initialisation of all variables.
Processing script code.
Closing (Ending) of script.
Error Handling.
These are described in detail in the following table:

The following script illustrates the above principles

LS_Coding_Guidelines.jpgLS_Coding_Guidelines_Example.jpg