Home > Domino Tips > Developer > LotusScript > 10 fundamental LotusScript tips
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

LOTUSSCRIPT

10 fundamental LotusScript tips


Bill Buchan
03.27.2007
Rating: -3.71- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


[TABLE]

Make sure you always use "Option Declare." It sounds obvious, but there are several determining factors as to why you should always use it. Here are some of the reasons:

[TABLE]

When working with templates and versions in LotusScript in custom code, there are a few things you should always do:

You might say these all sound like good reasons, but why should I use them? There are three major reasons:

[TABLE]

When dealing with the lifecycles of your applications, there are a few best practices you should follow:

Here is why you should adhere to these rules:

[TABLE]

Here are the fundamental how's and why's of how to code in LotusScript:

Here is why you should follow these LotusScript how-to coding guidelines:

[TABLE]

"Measure twice, cut one" may sound a bit cliche, but it is a good analogy when you are writing LotusScript code. Here are a couple ways it applies.

This works well because you are spending more time planning and less time doing actual labor.

[TABLE]

You should always try to use "ubound" to establish the size of your array. Below you will find an example of it in use.

If you set up your arrays this way, you won't need to keep a separate index of the array size; it also automatically trims the code. However, there is a minor drawback to implementing this. It will slow down large arrays, so you'll need to define the "empty" value. Otherwise, it works great.

[TABLE]

When you use the list operator, it stores a value with a unique lookup key. It's a good idea to use the list operator because:

Here is some example code:

[TABLE]

Another good tip is to log your LotusScript agents, especially i


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
LotusScript
LotusScript sorts lists alphabetically
LotusScript code rebuilds corrupted busytime.nsf file
Soft-code item names to facilitate LotusScript management
LotusScript agent automates selective mail file replication
LotusScript filters and attaches files to a Notes form
How to create mail files using a LotusScript agent
Extract value pairs from text arrays with LotusScript
Mass-input form uses LotusScript to ease large-scale employee moves
LotusScript button updates email addresses in Lotus Notes PAB
Code exports Lotus Notes data to an OpenOffice Calc spreadsheet

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


f they are scheduled agents. It's also a good idea if you have a broad range of clients. If you do, you need to log both your client and scheduled agents runtime status.

If you don't log your agents, chances are that your applications will break. Logging your agents will also help to let you know when your LotusScript agents do break. It's also a good timing metric for performance testing.

Show caution when logging your agents though -- you don't want to make the logging so slow that it affects application performance!

[TABLE]

When dealing with the structure of your LotusScript code, it is usually good to keep it as short as possible. Smaller code sequences are easier to deal with and maintain and are easily reusable. A good rule to go by is if your code is more than a screen's worth, you should determine if it is possible to break it up.

Some tips when determining your LotusScript code structure:

[TABLE]

When we say we're "hiding our code," we're basically saying that we're decomposing it so consumers can't see it. You don't want anyone to be able to view it, not even yourself.

When you hide your code, you are inferring a logical interface with clear naming. As such, your users and customers can write to the interface but not the code itself. This is good practice because it simplifies the coding experience.

You can easily hide your code by using "private/public" methods in your classes, script libraries, etc.

[IMAGE]
[IMAGE]TUTORIAL: 30 LOTUSSCRIPT TIPS
[IMAGE]
[IMAGE] Home: Introduction
[IMAGE] Part 1: 10 fundamental LotusScript tips
[IMAGE] Part 2: 10 everyday LotusScript tips
[IMAGE] Part 3: 10 advanced LotusScript tips
[IMAGE] Part 4: More LotusScript learning resources

Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts