Parameter.Set(Double)
Method
Description:
Sets the parameter to a new real number value.
Sets the parameter to a new real number value.
Remarks:
You should only use this method if the StorageType property reports the type of the parameter as a Double.
You should only use this method if the StorageType property reports the type of the parameter as a Double.
Examples
public bool SetParameter(Parameter parameter, double value)
{
bool result = false;
//if the parameter is readonly, you can�t change the value of it
if (null != parameter && !parameter.IsReadOnly)
{
StorageType parameterType = parameter.StorageType;
if (StorageType.Double != parameterType)
{
throw new Exception("The storagetypes of value and parameter are different!");
}
//If successful, the result is true
result = parameter.Set(value);
}
return result;
}
Parameters
Parameter | Type | Description |
---|---|---|
value | Double | The new double value to which the parameter is to be set. |
Return Value
Type | Description |
---|---|
Boolean | The Set method will return True if the parameter was successfully set to the new value, otherwise false. |
Exceptions
Exception | Condition |
---|---|
InvalidOperationException | The parameter is read-only. |
ArgumentException | Value must be a finite number. |