General Syntax Rules

The Formula Language syntax rules are quite simple. All formulas must adhere to the following five rules.

Rule 1.

A semicolon must separate all formulas that contain more than one statement. It's important to understand that multiple statements can reside on a single line, provided that a semicolon delineates each statement. For example, the following are valid multi-statement formulas.

Example 1
 

DEFAULT status := "New Request"; status

Example 2
 
DEFAULT status := "New Request";
status
 

Rule 2.

At least one space must follow all reserved keywords. Otherwise, any number of spacesfrom none to manymay be used to separate operators, punctuation, and values. For example, the following are valid and equivalent statements (with regard to spacing):
 

output := "Today's date is: " + @Today;
output:="Today's date is:" + @Today;
FIELD output:= "Today's date is: " + @Today;
 

Rule 3.

Two values, variables, or strings must be separated by at least one operator. For example, the following are valid statements. In the first example, the plus sign is used to sum the two numbers and divide the result by 2. In the second example, the plus sign is used to concatenate two values together. Finally, the third example shows three @Functions separated by the plus operator.
 

output := (100 + 200)/2;
output := "The sum of the two numbers is: " + total;
output := @Month+@Day+@Year;
 
   

Rule 4.

You must use the := assignment operator to assign a value to a variable, whereas the equal sign = is used to compare two values when used in a conditional statement (such as the @IF, @WHILE, or @FOR functions).
 

myVariable := "This is a valid assignment";
 

Rule 5.

All formulas must contain a main expression that either produces a value or performs an action. For example, the following are valid main expressions.

The following returns today's date.
 

@Today

The following checks if the value stored in the result variable is equal to one. If the condition is true, then the formula returns the text string "Yes". Otherwise, the formula is set to a text string "No".
 
@If (result = 1; "Yes"; "No")
 


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
Similar book on Amazon

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