Scripts
The Scripts tab gathers the modules of procedures written in Argile, Khnoum's language. This is where you put what the ready-made actions cannot do: a calculation, a business rule, a repeated task.
Modules and procedures
A module is a .argile file in the project's scripts folder. The list on the left shows the modules and the number of procedures in each. The + button adds one; the bin deletes it.
A module's procedures are visible to the whole project: in the other modules, in event code, and in the "Call a procedure" action of the Interactions tab.
// Procedures shared by all windows.
procedure Welcome(name: string): string
if trim(name) = "" then
return translate("welcome_anonymous")
end
return "Hello " + name + "!"
end
The code editor
The editor helps you at every keystroke:
-
Highlighting: keywords, types, texts, numbers, comments, functions, entities and controls each have their own color.
-
Completion: as soon as you type a word or a dot, or with Ctrl+Space, the editor suggests what exists in your project:
- entities and their fields after
Client.; - a window's controls and their properties after
SAI_Nom.; - procedures, native functions, keywords.
↑ and ↓ choose, Enter or Tab accepts, Esc closes.
- entities and their fields after
-
Indentation: Tab indents, and Enter keeps the line's indentation.
-
Checking: the module is checked as you type. The header shows "No errors" or the number of problems, listed under the editor with their line; the bottom bar counts the errors of the whole project.
"Show the generated Rust" shows your module translated into Rust, exactly as it will be compiled.
The reference at hand
The right-hand panel, Argile reference, presents the syntax and every function, with its signature and its English names. The search field filters the list.
The same language everywhere
Argile is also used:
- in the "Argile code" action of an event;
- in the expressions of actions (values, conditions);
- in the formulas and filters of reports.
The Argile language reference describes the whole language: types, statements, windows, data, reports and native functions.