VIEW MEMBER FEEDACK TO THIS TIP
These are some basic guidelines for coding agents. Although each developer is unique in his or her coding standard, I wanted to share my style for coding an agent.
1) Naming Convention: agentName | agt<abbreviatedAgentName>
2) Use Option Explicit in the Options section. Make use of shared code from existing script libraries. Most of the times, you have a sendMail() in you script library. So make use of it like this -- use "<scriptlibraryname>".
3) In the Declarations section, put the agent task and its functionality in easy English language. For example,
4) Declare global variables
in the Declarations section. For example:
5) In the Initialize section,
first line should be errorHandler.
Here, handleError is a logger function placed in the script library which you can create yourself that will help in debugging the application errors.
6) Make use of subroutines or functions in the agent's local domain. This will make you code more readable and structured. This will make your life easy when a code change is required in the agent or function.
7)
To continue reading for free, register below or login
To read more you must become a member of SearchDomino.com
');
// -->

When using arrays, make sure to use the following statement in the lifecycle of the agent: Erase <arrayName>
8) Whenever referring an object or variable, test it for not being set to Nothing:
MEMBER FEEDBACK TO THIS TIP
Coding standards and error handling can be overused. You must use 'Option Declare' -- not only in agents, but in all LotusScript agents.
I'm not sure about putting AGT in the front of the agent. It is far better to name the design element based on its purpose. This makes life easier for other developers who have to understand what you were trying to do.
It's much better to concentrate on performance limitations, and write your code as efficiently as possible. That way, as your applications grow in size, performance won't suffer.
Andrew B.
Do you have comments on this tip? Let us know.
This tip was submitted to the SearchDomino.com tip exchange by member Sunilkumar Vishwakarma. Please let others know how useful it is via the rating scale below. Do you have a useful Notes/Domino tip or code to share? Submit it to our bimonthly tip contest and you could win a prize and a spot in our Hall of Fame.