Adds a new variable with specified value. If the variable already exists, its value is updated with the new value. If the variable exists and is a constant, the value is not updated and no error is reported. If the variable does not exist, it is created using the variable factory of the jep instance specified with the Init(JepInstance) method.

Namespace:  SingularSys.Jep
Assembly:  Jep (in Jep.dll) Version: 1.1.0.0 (1.0.0)

Syntax

C#
public Variable AddVariable(
	string name,
	Object value
)
Visual Basic (Declaration)
Public Function AddVariable ( _
	name As String, _
	value As Object _
) As Variable
Visual C++
public:
Variable^ AddVariable(
	String^ name, 
	Object^ value
)

Parameters

name
Type: System..::.String
the name of the variable
value
Type: System..::.Object
the value for the variable to be set to

Return Value

the variable added or updated

Exceptions

ExceptionCondition
SingularSys.Jep..::.JepExceptionif an attempt is made to set the value of a constant variable

See Also