Information about your program. This will be saved into the program when you save it.
Choose a theme for the application. This setting will be saved for the current user, but not in your program.
Save the flow chart as an image, so you can put it in your documents or web pages. Note that exported programs are just images and you won't be able to open them in Flogo.
Don't touch these unless you know what you're doing.
Variables can be used to store data that your program needs to work.
Each variable has:
n is not the same as the variable N.
Can be used to store integer numbers, positive or negative.
If a real number is stored into an integer, the decimal digits are lost.
Valid values for an integer are -9007199254740991 to 9007199254740991.
Can be used to store real numbers, positive or negative.
Real numbers don't have a valid range, but they lose accuracy as they become larger.
It is generally a bad idea to store an integer number in a real variable.
Can be used to store text. The maximum allowed length is `1048576` characters (about 1 million).
Can store a value that's either true or false.
Can store multiple values of the same basic type. See Arrays.
Reads a value from the user and stores it in a variable.
Evaluates an expression and shows the result to the user.
+ symbol. Example: "The total is "+total+"€"Evaluates an expression and stores the result in a variable.
Be careful! Some automatic type conversions can happen if variables are not of the same type. For instance, if the expression gives a real value but your variable is an integer, it will lose the decimal digits; if the expression gives an integer number and your variable is a string, it will be converted to text. Your program only crashes if the types are completely incompatible, for instance if your expression gives a string but you're trying to store it in a real variable.
Evaluates an expression and executes the True or False branch depending on the result.
The expression can contain numbers, variables, mathematical operators, etc. but it can also contain comparison and logical operators. For instance, the expression a>=0&&a<=10 tells you if the variable a is between 0 and 10.
It's important to remember that the expression must give a true/false value, any other type will crash your program.
Repeats the instructions inside it until the condition at the end becomes false.
The condition is checked at the end of each loop, so the contents of the loop will always be executed at least once; this makes it useful for things like input validation.
Like in the If instruction, the condition must give a true/false value.
Repeats the instructions inside it until the condition at the top becomes false.
The condition is checked at the beginning of each loop, so it's possible for the loop to not be executed at all if the condition is immediately false.
Like in the If instruction, the condition must give a true/false value.
A for loop repeats the instructions inside it like a While loop, but it also handles a variable (usually a counter) automatically, incrementing or decrementing it at the end of each loop.
Note: the from-to range is inclusive!
Comments have no effect on the program, they are useful to store notes or to document how things work.
Automatically pauses execution of the program. Useful for debugging.
Expressions can be used to write mathematical expressions, conditions and conditions.
Expressions can contain a mix of variables, values, operators and functions.
Variable names and numeric values can be written directly (for instance, a+1), strings must use quotes or double quotes (for instance, 'The price is: '+price), functions use parenthesis and commas to delimit their parameters (for instance, toFixed(price,2)).
Expressions are evaluated in this order:
The following tables list all the operators included in Flogo in order of precedence. Round parenthesis can be used to alter the order of evaluation of the expression (for instance, n/(a+1)); parenthesis can also be nested.
| Operator | Description |
|---|---|
| a ^ b | Power |
| a * b | Multiplication |
| a / b | Division (real) |
| a % b | Modulus (remainder of integer division) |
| a + b | Addition (if both operands are numbers) |
| a + b | String concatenation (if at least one of the operands is a string) |
| a - b | Subtraction |
Comparison operators can be used in conditions to compare a value to another. For instance, a==0 is true if the variable a has a value of 0.
| Operator | Description |
|---|---|
| a < b | Lower than |
| a > b | Greater than |
| a <= b | Lower or equal |
| a >= b | Greater or equal |
| a == b | Equals |
| a != b | Different |
Logical operators allow you to "chain together" multiple conditions. For instance, a<0||a>10 is true if the variable a is not between 0 and 10.
| Operator | Description |
|---|---|
| ! expr | Not Inverts the value of the expression |
| a && b | And All expressions must be true for the entire condition to be true |
| a || b | Or At least one expression must be true for the entire condition to be true |
Flogo has a lot of built-in functions that make writing expressions easier. For instance, round(a) will give you the value of the variable a rounded mathematically to the nearest integer.
| Function | Description |
|---|---|
| abs(n) | Absolute value |
| sqrt(n) | Square root |
| sin(n) | Sine (n is an angle in radians) |
| cos(n) | Cosine (n is an angle in radians) |
| tan(n) | Tangent (n is an angle in radians) |
| asin(n) | Arcsine |
| acos(n) | Arcosine |
| atan(n) | Arctangent |
| ln(n) | Natural logarithm (base E) |
| log(base,val) | Logarithm |
| ceil(n) | Round up to nearest integer |
| floor(n) | Round down to nearest integer |
| round(n) | Mathematical rounding |
| random() | Random real number between 0 and 1 |
| Function | Description |
|---|---|
| toFixed(n,d) | Converts a number into a string with d decimal digits |
| len(s) | Length of a string |
| end(s) | Position of the last character of a string (same as len(s)-1, useful in for loops) |
| charAt(s,i) | Returns the character in position i in the string s. The first character in a string has position 0 |
| charToCode(c) | Converts a character into the corresponding ASCII code (integer) |
| codeToChar(n) | Converts an ASCII code into the corresponding character |
| strToReal(s) | Converts a string into a real number |
| strToInt(s) | Converts a string into an integer number |
| Function | Description |
|---|---|
| len(s) | Length of an array |
| end(s) | Position of the last cell of an array (same as len(s)-1, useful in for loops) |
| Constant | Value |
|---|---|
| PI | 3.141592653589793 |
| E | 2.718281828459045 |
| CURRENT_DAY | Current day of month |
| CURRENT_MONTH | Current month (1=January, 12=December) |
| CURRENT_YEAR | Current year |
| CURRENT_HOURS | Current hours (24h format) |
| CURRENT_MINUTES | Current minutes |
| CURRENT_SECONDS | Current seconds |
Arrays are a special type of variable that allows you to store more than one value.
The way they work is very simple: to create an array, make a variable and set the type to Array, then choose one of the 4 data types: Integer, Real, String or Boolean, and give it a size, that's how many values the array can store.
Arrays can be used like normal variables; for instance, if you declare an array a of type Integer and size 100, that would be like declaring 100 integer variables named from a[0] to a[99]. All these variables (called cells or items of the array) are not initialized when the program starts. The number between the square brackets is called index, and it indicates which cell of the array you're trying to use.
a[100], or if you try to read from an uninitialized cell, your program will crash; remember that indices go from 0 to the size-1, and that you cannot use uninitialized variables in expressions.
You can also use an expression as an index when using an array. For instance, let's say that you want to read 10 numbers and store them for later, if you do that by declaring 10 variables, you'd need 10 input instructions; but with arrays you can use loops, so you can just write a loop for i=0 to 9 and input a[i] at each step.
This makes arrays extremely powerful and versatile.
Arrays cannot be used directly in expressions and assignments, only their individual cells can. For instance, if you have an array a and you try to output a directly will crash your program; if you want to print the contents of the array, you need to use a loop.
While your program is running, you can see the contents of your arrays in real time by expanding them in the variables list.
Sometimes you don't know how big your array needs to be when you're writing your program. Arrays in Flogo are static, meaning that they cannot change size while the program is running, but nothing stops you from declaring a large enough array and storing the size separately in an integer variable, that way the size can change at any time without actually resizing the array. We call that variable logical size. Keep in mind that the end and len functions will still give you the full size of the array, not the logical size!
The basic concept behind Turtle Graphics is that you're controlling a cursor (called "turtle", but his real name is Augustino). When the program is started, the turtle is at the center of the drawing area and it's pointing up (this is its "home"), and you can use instructions to move it, draw a line while moving, turn it left or right and it can also instantly move back to its home.
A Move/Draw instruction moves the turtle by the specified distance in the direction that it's currently pointing at. It can draw a line behind it while moving.
A Move/Draw instruction changes the angle that the turtle is currently pointing at by a specified amount of degrees.
Instantly moves the turtle back to the starting position (its "home"), pointing upwards. It does not draw a line while moving.