Method SetVariables
SetVariables(string, VariableFormat)
Assign the specified variables to the calculator instance
Declaration
void SetVariables(string variables, VariableFormat format = VariableFormat.Xml)
Parameters
| Type | Name | Description |
|---|---|---|
| string | variables | Variables and their associated values and attributes in the specified data format |
| VariableFormat | format | Format of the variables, the default is XML |
Remarks
The Calculator currently supports one format for defining variables which uses XML. The XML schema is not documented and is subject to change, however the Tedds Calculator itself can be used to generate the required XML. To create the XML string create an instance of the XML calculator and initialize the calculator using Initialize, omitting all of the optional parameters. For each variable you wish to assign in the XML use Functions.SetVar or Functions.SetVarExpr. Once all the required variables have been assigned use @ref GetVariables to retrieve an XML string of all the variables which have been defined. This XML string can then be used with SetVariables although normally the variables would be initialized using one of the Initialize or InitializeCalc functions.