PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Supported types
  • Mean of durations
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Calculates the mean of several elements:
  • elements found in an array,
  • numeric values, ...
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
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
Index of the array column containing the values 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).
  • real (4 or 8-byte), currency and numeric types.
  • the Date type.

Mean of durations

If Mean is used to calculate an average of durations, all parameters must be of type Duration.


Sequence of functions
You can use array functions in a sequence.
The following functions can be used in a sequence: This sequence can be used as a source for a FOR ALL statement or it can end with one of the following functions:
Example:
gnMean = garrUser.Filter(cbFilter).Map(cbMap).Mean()
Business / UI classification: Neutral code
Component: wd280wm.dll
Minimum version required
  • Version 17
This page is also available for…
Comments
Click [Add] to post a comment