The Formula language is a
scripting language
A scripting language or script language is a programming language that is used to manipulate, customize, and automate the facilities of an existing system. Scripting languages are usually interpreted at runtime rather than compiled.
A scripti ...
used by
Lotus Notes
HCL Notes (formerly IBM Notes and Lotus Notes; see Branding below) and HCL Domino (formerly IBM Domino and Lotus Domino) are the client and server, respectively, of a collaborative client-server software platform formerly sold by IBM, now by HCL ...
.
It is often referred to as @Formula language (pronounced ''at-formula'') because many language elements start with the @-character. Here is an example of a selection formula:
SELECT @NoteId = "NT0050D26"
It was created by
Ray Ozzie
Raymond "Ray" Ozzie (born November 20, 1955) is an American software industry entrepreneur who held the positions of Chief Technical Officer and Chief Software Architect at Microsoft between 2005 and 2010. Before Microsoft, he was best known for ...
during the early development of Lotus Notes. He borrowed the compiler and decompiler from the
Lotus 1-2-3
Lotus 1-2-3 is a discontinued spreadsheet program from Lotus Software (later part of IBM). It was the first killer application of the IBM PC, was hugely popular in the 1980s, and significantly contributed to the success of IBM PC-compatible ...
spreadsheet, but unlike the spreadsheet language Formula Language was designed primarily for string and list processing, not numerical processing. It was originally a
Functional programming
In computer science, functional programming is a programming paradigm where programs are constructed by applying and composing functions. It is a declarative programming paradigm in which function definitions are trees of expressions that ...
language with unique text list-handling features inspired by Ray Ozzie's prior use of
Icon
An icon () is a religious work of art, most commonly a painting, in the cultures of the Eastern Orthodox, Oriental Orthodox, and Catholic churches. They are not simply artworks; "an icon is a sacred image used in religious devotion". The most c ...
and
Lisp
A lisp is a speech impairment in which a person misarticulates sibilants (, , , , , , , ). These misarticulations often result in unclear speech.
Types
* A frontal lisp occurs when the tongue is placed anterior to the target. Interdental lispi ...
.
The Formula language engine was rewritten by Damien Katz for Notes and Domino 6. New features were added to the language, such as looping and dynamic execution, and performance was improved.
The Formula language has two parts:
* ''@Functions'' for calculations and simple logic
* ''@Commands'' for performing actions in the user interface
''@Functions'' can be used in several places throughout Lotus Notes. The most important uses are:
* to select documents to show to the user in a view (a kind of index) or to select documents for further processing. In this case, the formula will evaluate to a 'true' (selected) or 'false' value (not selected) for each document.
* to provide default values for fields, to transform the data entered by the user (like stripping off redundant spaces) and to validate this data.
* to get a list of values from a Notes database or even from a relational database (using
ODBC
In computing, Open Database Connectivity (ODBC) is a standard application programming interface (API) for accessing database management systems (DBMS). The designers of ODBC aimed to make it independent of database systems and operating systems. A ...
). This may be used to provide a user with a list of values to choose from.
* to process a set of documents. The formula is placed in an agent, a program or macro that can be started by a user or by the Notes server according to a schedule. When the agent is triggered, the formula executes for each selected document (this a very limited form of a loop). This is an efficient way to change many documents, if the logic is not too complicated. In case of complicated changes,
LotusScript LotusScript is an object oriented programming language used by Lotus Notes (since version 4.0) and other IBM Lotus Software products.
LotusScript is similar to Visual Basic. Developers familiar with one can easily understand the syntax and struct ...
is used.
''@Commands'' are like menu commands: they perform actions in the Lotus Notes client. Examples of actions are:
* opening a Notes database
* creating an e-mail
* putting the cursor in a specific data-entry field
* closing a window
* starting an agent
@Commands are primarily used in formulas that are triggered by user action, such as in button formulas. It is possible to combine them with @Functions, for example by making execution of an @command conditional on a field value.
References
{{Reflist
Scripting languages
Functional languages
Lotus Software software