SetExpressionValueResult SetExpressionValue(OdId tObject, SetExpressionValueArg tArg)
tObject. Moniker of the development environment object, for which debugging is running.
tArg. Operation execution parameters.
The SetExpressionValue operation changes expression value during code debugging.
The operation changes the expression that takes simple data type value. To execute the operation, in the tObject field specify moniker of the object that is in debugging mode, and in the tArg field specify value change parameters.
The operation results in the updated information about expression calculation result.
Below is the example of changing expression value during code debugging. The request contains moniker of the object that is in debugging mode, and the expression to be changed with new value. The response contains the updated information about the expression.
{
"SetExpressionValue" :
{
"tObject" :
{
"id" : "PBIOBPCAEDCOFOAEFFEFLOBMFDKGKIMENIGAAFCLHCNIIEAC!M!305559"
},
"tArg" :
{
"expression" : "count",
"newValue" : "50"
}
}
}
{
"SetExpressionValueResult" :
{
"resultStruct" :
{
"name" : "count",
"className" : "System.Integer",
"value" : "50"
}
}
}
public static SetExpressionValueResult SetExpressionValue(MbId mb, string modId, string evaluateExpression, string newExprValue)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tSet = new SetExpressionValue()
{
tArg = new SetExpressionValueArg()
{
expression = evaluateExpression,
newValue = newExprValue
},
// Create object moniker
tObject = new OdId() { id = mb.id + "!" + FindObjectById(mb, modId).k }
};
// Change value
var result = somClient.SetExpressionValue(tSet);
return result;
}
See also: