Prd

This function is used to calculate the multiplication for a list of numeric elements. It works on a list of elements that can be:
* Expressions.
* Arrays or sub-arrays of an array.
* Properties in an array of references.

Syntax

prd(ELEMENT_LIST)

Examples

# Calculates the average value for a list of computed valuesFINAL_PRICE=prd(INITIAL_PRICE, COMPANY_MARKUP, SALESREP_MARKUP)# product on a matrix of values# We have NB_SALESREP sales representative in our department (NB_SALESREP<20)Local Decimal COEFFICIENTS(1..12), INITIAL_VALUE, FINAL_VALUELocal Integer MONTH# Fill the arrayFor MONTH=1 To 12COEFFICIENT(MONTH)=func GET_COEFF(MONTH)Next MONTHINITIAL_VALUE=func GET_INITIAL_VALUE# Find out the final value after a yearFINAL_VALUE=prd(INITIAL_VALUE, COEFFICIENT(1..12))

Comments

Decimal, Integer, Float, Double, TinyInt, and Shortint data type variables may be mixed.

If one of the arguments in the function is an array variable without specifying index or range of indexes, all the variable elements are used. The specified index or range of indexes determines the elements to be considered.

If a range of indexes is given such that there is no element to consider, the result returned is 1.

See also

sum, avg, max, min.