-
Notifications
You must be signed in to change notification settings - Fork 1
MultiSubtract
jdubs edited this page Oct 21, 2016
·
1 revision
Performs mathematical operation of subtraction and formats number when specified.
Numbers (multiple) The array of values to add together. Ex: {3}{Variable}{8}
SpecName (constant) The name of the variable for operation result assignment
NumberFormatCode (multiple) The numeric format code (see addendum 1)
ErrorMessage (multiple | optional) The error message to return when any error occurs.
Performs simple mathematical calculation on the array of numbers and returns the result to a defined variable which may be used in other defined actions.
public static void MultiSubtract(object Numbers, string SpecName, object NumberFormatCode, object ErrorMessage)
{
Break();
try
{
double count = 0;
object[] numbers = ParseArray(Numbers);
foreach (object n in numbers)
{
count -= N(n);
}
Variable(SpecName).Value = count.ToString((string)NumberFormatCode);
}
catch (Exception ex)
{
throw new Four51ActionsException(ex.Message, (string)ErrorMessage);
}
}