Anatomy of a program
On this page, you will learn about the basic anatomy of the FlowScript programs you can write in script steps.
Statements
A FlowScript program consists of a series of statements. When your application is run and reaches a script step, the program statements inside it are executed top-to-bottom.
Statements are generally terminated by a semicolon (;) character. While not mandatory, the semicolons are recommended, as they help FlowScript give you better error information should you make a typo somewhere in the code.
The following example shows a program consisting of two statements. The first statement declares a variable called x and assigns it the value 1, and the second statements uses the return keyword to end the script with the value of x as its final result.
Case and whitespace
FlowScript has case sensitive identifiers. The variable name user is considered distinct from the variable name User.
However, all language keywords are case insensitive. The following is valid:
For reasons of backward compatibility with Flow Classic, the names of built-in functions are also case insensitive.
In some languages, white space is a significant part of the syntax, but this it not the case in FlowScript. You may choose freely where to use white space characters such as tabs, line breaks and spaces.
Comments
You can write comments in your program. These are ignored when the application is run. There are two ways to write comments:
Return
A return statement ends the execution of a program and provides a result. Programs must always end with some result.
Any statement placed after a return statement is ignored.
Last updated