How do I call a function?
Start typing in the code field after =: the name of the function. For example, round. You will be offered autocomplete — press enter and then put an opening or closing parenthesis.
= : round(num: ; type: "up|down|math"; step: 0.5; dectimal: 1)
The appearance of functions in Totum is the name before the parentheses, and inside the parentheses are the parameters. Let's complete it:
= : round(num: $number; type: "up"; step: 0.5; dectimal: 1)
number: 0.3
// The result will be — 0.5.
Can I leave function parameters unfilled?
No, you can't! All unnecessary parameters must be removed.
How do I highlight the next function parameter?
Parameters are separated by ;. If the cursor is positioned before the closing parameter ;, pressing Shift + Tab will select the next function parameter.
If you press Tab, only the value of the next parameter will be selected.
How to highlight the current function parameter?
Place the cursor between any characters of the parameter and press Shift + Tab.
How to add a parameter to a function?
Start typing the parameter name after one of the closing ;.
How do I call up a list of all parameters?
If you place an additional ; between the closing parameter ; and the beginning of the next parameter, Totum will offer you a list of parameters — you can choose the one you need.
How do I quickly fill a function with just the necessary parameters?
Type the function name and replace ( with /, select the parameter and again replace / with /. When you have selected the necessary ones, then put (.
It is considered good practice to use parameters in the order they are listed in the autocomplete and documentation.
You can always view the autocomplete for the function by right-clicking on it – there is also a quick jump to the documentation for this function.
Can a function be called inside another function?
No — this is done through a separate line:
example2: select(table: 'tablename'; field: 'fieldname1'; where: 'price' = $what_id)
what_id: round(num: #price; type: "up"; step: 1; dectimal: 0)