ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Queue, stack, list and array functions / Array functions
  • Supported types
  • Sum of durations
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Calculates the sum of the array elements.
Example
// Somme des éléments d'un tableau d'entiers
MonTableau is array of int = [1,2,3]
MaSomme is numeric
MaSomme = MonTableau.Sum() // MaSomme = 6
Syntax

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

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

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

<Result> = <Array>.Sum(<Member>)
<Result>: Numeric
Sum of the values of members.
<Array>: Array variable
Name of the one-dimensional array of structured types. Permitted structured types are: class, dynamic class, structure, dynamic structure.
Note: In an array of dynamic classes or dynamic structures, if the element is not allocated, it is ignored.
<Member>: Character string
Name of the member containing the values that must be used to calculate the sum.

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

<Result> = <Array>.Sum(<Column>)
<Result>: Numeric
Sum of the column values.
<Array>: Array variable
Name of the two-dimensional numeric array.
<Column>: Integer
Index of the array column containing the values that must be used to calculate the sum.
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 Duration type.

Sum of durations

If <Array>.Sum is used to calculate a sum 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: wd300vm.dll
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/26/2024

Send a report | Local help