Alf may be used as a scripting language to write simple expressions without the need to compile the script. Scripts can be used in the body of Opaque Actions, Opaque Behaviors, Opaque Expressions, State Machine Guards, or even directly in the Simulation Console. 

Simple Alf scripts used in State Machine diagram

Using Alf as a scripting language

Alf-Library must be loaded into the project to use as a scripting language.

   

To load the Alf-Library


  

In the script editor window, the language must be set to "Alf Script". The scripting window has an automatic syntax and constraint check, the same as the Alf editor window.

Alf scripts do not support the interpretation of all Alf language expressions. Currently supported expressions are: