The following section will give you some help in structuring your LotusScript code for event programming within Domino.
Do any or all of the following to improve your scripts:
Declare all variables in the global definitions for an object and use the Option Public statement. Next, instantiate the variables in the PostOpen event or in a subroutine that you can call from either the QueryOpen event (for an existing document), or the PostOpen event (for a new document). Your variables will be easier to find and maintain, and you’ll be able to use them in any script for the object.
It is recommended that you use Option Explicit or Option Declare to make certain that ...