AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de colas, pilas, listas y arrays / Funciones de arrays
  • 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 the values within an array.
Example
// Mean of elements found in an array of integers
MyArray is array of int = [1,2,3]
MyMean is numeric
MyMean = MyArray.Mean() // MyMean = 2
Syntax

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

<Result> = <Array>.Mean()
<Result>: Numeric
Mean of the numeric elements found in the array.
<Array>: Control name
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> = <Array>.Mean(<Member>)
<Result>: Numeric
Mean of values of members.
<Array>: Control name
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> = <Array>.Mean(<Column>)
<Result>: Numeric
Mean of column values.
<Array>: Control name
Name of the two-dimensional numeric array.
<Column>: Integer
Index of the array column containing the values 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 <Array>.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: wd290wm.dll
Versión mínima requerida
  • Versión 24
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 21/06/2023

Señalar un error o enviar una sugerencia | Ayuda local