Core.SetVariable
Sets a declared Variable name in the SILVIA Core. All SILVIA Core Variables are “tokenized” with string names beginning “$”. This allows the Variables to be used in Absorbers and Exuders, e.g. if a Core Variable “$keyword” is set with the value “AI”, an Absorber or Exuder using the text “$keyword” will either expect the input “AI”, or speak “AI”.
Description
SILVIA Cores can store variables in by Variable Name and Value. Variables in SILVIA are all named by strings starting with “$”. Variables with names beginning “$_” are sorted into the System Variables side of the State Monitor, whereas Variables with names beginning “$” without an underscore are sorted into the Trainer Variables side of the State Monitor.
Example Usage (C#)
string aiName = "Silvia 3";
Core.SetVariable("$_a", aiName, false);
Parameters
string |
variableName |
The name of the Variable to store in the SILVIA Core. Always declare Variable names beginning with “$”. |
string |
value |
The string value or reference to store in the under the given Variable name. |
bool |
additive |
The boolean flag whether to additively store the Variable. If true, values will be concatenated separated by a “|” (Pipe-separated); if false, the value of the given Variable name will be set or replaced with the supplied value. |
Returns
The boolean success or failure of the operation.
See Also
- Core.GetVariable
- Core.GetInt
- Core.GetFloat