set_Variable method
The set_Variable method sets the value of a referenced variable by using the name of the variable.
Description
.NET restriction: For VBScript, use the Variable instead.
If
you set a variable that does not exist in the runtime object, this
method automatically creates the variable.Datacap uses a number of standard variables. For a listing of these variables, see the Standard Variable Reference in this IBM® Knowledge Center.
Syntax
- C#
string set_Variable(string lpszName, string pVal)
Arguments
- lpszName
- The name of the variable, the value of which you want to set.
- pVal
- The value.
Applies to
All objects.C# example
The following example assigns the value IBM to the variable Company.
m_oDCO.set_Variable("Company", "IBM")
The method either sets the value if the variable exists, or creates a new variable with the specified value. The following sample XML node shows the resulting variable and the value:
<V n="Company">IBM</V>