Skip to content

Flow documentation · legacy product

Scripts ​

Scripts are the code that you provide and attach to an Event (Refer Events). A script has an initial skeleton that is provided by the script engine. You enter your script code within this skeleton. The following is a typical script skeleton.

pascal
procedure ScriptEvent (var Value : variant);
begin

end;

DANGER

The first line indicates the name of the script and under all circumstances must not be changed.

Inputting script code ​

The second and fourth line are the begin..end block (ReferStatements) within which you should enter your script. You must not remove this begin...end block. The following is an example of script code being entered - this code adds an entry to the logs during execution of the map.

pascal
procedure ScriptEvent (var Value : variant);
begin
loginfo('I want to add this text to the log');
end;

Declaring variables ​

Variables can be declared between the first and second lines. Create a new line directly after the first line and enter your variable declarations. For more information on variables and how to declare them refer to Variables. The following is an example of a Integer variable being declared. The variable name is MyVariable

pascal
procedure ScriptEvent (var Value : variant);
var MyVariable : Integer
begin

end;

TIP

Variable names are not case sensitive in a script. If you declare as MyVariable you can reference it is myvariable