Working with Iterative Loops

The following are functions that can be used to manage loops. To implement these functions, you must be running Lotus Notes release 6 or greater.

Function

Description

Example

@For

Executes one or more statements while the specified condition remains true. After each execution, the condition is rechecked to verify that the statement remains true. Syntax:

@For ( initialize; condition;
 increment; statement);
 

initializeThe starting value for the loop counter.

conditionA true or false condition.

incrementA statement that changes the counter.

statementA formula language statement to execute. Up to 254 statements can be specified.

The following loops through the elements of a keyword field called Options. With each iteration, a counter called cntr is incremented and the keyword element is displayed to the user.

@For(cntr:= 1;
cntr <=
 @Elements(Options);
cntr:= cntr + 1;
@Prompt([OK]; "Item "
 + @Text(cntr)" is ";
 Options[cntr]))
 

@While

Executes one or more statements while the specified condition remains true. Syntax:

@While ( condition; statement );
 

conditionA true or false condition.

statementA formula language statement to execute. Up to 254 statements can be specified.

Note: There is also a @DoWhile statement, which was introduced in release 6.

The following loops through the elements of a keyword field called Options. Each element is displayed and a counter is incremented with each loop.

cntr:= 1;
@While(cntr >=
 @Elements(Options);
@Prompt([OK]; "Item "
 + @Text(cntr)" is ";
 Options [cntr]);
cntr:= cntr + 1)
 


Working with Lookup Functions

An Introduction to the Lotus Domino Tool Suite

Getting Started with Designer

Navigating the Domino Designer Workspace

Domino Design Elements

An Introduction to Formula Language

An Introduction to LotusScript

Fundamentals of a Notes Application

Calendar Applications

Collaborative Applications

Reference Library Applications

Workflow Applications

Web Applications

Design Enhancements Using LotusScript

Design Enhancements Using Formula Language

View Enhancements

Sample Agents

Miscellaneous Enhancements and Tips for Domino Databases

Data Management

Security

Application Deployment and Maintenance

Troubleshooting

Appendix A. Online Project Files and Sample Applications

Appendix B. IBM® Lotus® Notes® and Domino®Whats Next?



Lotus Notes Developer's Toolbox(c) Tips for Rapid and Successful Deployment
Lotus Notes Developers Toolbox: Tips for Rapid and Successful Deployment
ISBN: 0132214482
EAN: 2147483647
Year: N/A
Pages: 293
Authors: Mark Elliott

Flylib.com © 2008-2020.
If you may any questions please contact us: flylib@qtcs.net