PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Supported types
  • Mean of durations
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Calculates the mean of several elements:
  • elements found in an array,
  • numeric values, ...
Versions 25 and later
WEBDEV - Browser code This function is now available in browser code.
New in version 25
WEBDEV - Browser code This function is now available in browser code.
WEBDEV - Browser code This function is now available in browser code.
Example
// Mean of elements found in an array of integers
MyArray is array of int = [1,2,3]
MyMean is numeric
MyMean = Mean(MyArray) // MyMean = 2
Syntax

Calculating the mean of the elements found in a one-dimensional array (numeric types) Hide the details

<Result> = Mean(<Array>)
<Result>: Numeric
Mean of the numeric elements found in the array.
<Array>: Array variable
Name of the one-dimensional array of numeric types containing the elements whose mean must be calculated.

Calculating the mean of the elements found in a one-dimensional array (structured types) Hide the details

<Result> = Mean(<Array> , <Member>)
<Result>: Numeric
Mean of values of members.
<Array>: Array variable
Name of the one-dimensional array of structured types. The following structured types are allowed: class, dynamic class, structure, dynamic structure.
Remark: In an array of dynamic classes or in an array of dynamic structures, the element is ignored if it is not allocated.
<Member>: Character string (with or without quotes)
Name of the member containing the values that must be used to calculate the mean.

Calculating the mean of the elements found in a column of a two-dimensional array Hide the details

<Result> = Mean(<Array> , <Column>)
<Result>: Numeric
Mean of column values.
<Array>: Array variable
Name of the two-dimensional numeric array.
<Column>: Integer
Subscript of the array column containing the values that must be used to calculate the mean.

Calculating the mean of several values Hide the details

<Result> = Mean(<Value 1> , <Value 2> [, <Value 3> [... [, <Value N>]]])
<Result>: Numeric
Mean of values.
<Value 1>: Numeric
First value that must be used to calculate the mean.
<Value 2>: Numeric
Second value that must be used to calculate the mean.
<Value 3>: Numeric
Third value that must be used to calculate the mean.
<Value N>: Numeric
Last value that must be used to calculate the mean.
Remarks

Supported types

The following types are supported for the arrays of numeric values and for the members of arrays of structured types:
  • all integer types (on 1, 2, 4 or 8 bytes, signed or unsigned + system integer).
  • the real type (on 4 or 8 bytes), the currency type and the numeric type.
  • the Date type.

Mean of durations

If Mean is used to calculate a sum of durations, all the parameters must have the Duration type.
Business / UI classification : Neutral code
Component : wd250mat.dll
Minimum version required
  • Version 17
This page is also available for…
Comments
Click [Add] to post a comment