ApiData().SetBehaviorScript

Sets the programmatic script content for the Behavior.

Description

This function sets the script content for any one of three execution stages in a particular identified Behavior, modifying the current SILVIA Brain to do so. These stages include “val” (Validation), “pre” (Pre-Behavior), and “post” (Post-Behavior). C# (C-Sharp) is the default Scripting Language for the SILVIA Core, and is defined as “cs” for the purposes of this method.

Example Usages (C#)


bool success = _core.ApiData().SetBehaviorScript(147, “val”, “cs”, myValidationScript);
success = _core.ApiData().SetBehaviorScript(147, “pre”, “cs”, myPreScript); success = _core.ApiData().SetBehaviorScript(147, “post”, “cs”, myPostScript);

Parameters

int

id

The numeric integer value or variable id of the Behavior to modify by setting the script.

string

stage

The string value representing one of the three Scripting Stages, “val”, “pre”, or “post”.

string

language

The string value representing the Scripting Language C#, “cs”.

string

script

The string value representing the script code to apply to the given Behavior.

Returns

The boolean success or failure of the operation

ApiData()