dynSum()

Adds field elements.

Synopsis

int dynSum( dyn_int x [, dyn_bool mask] );

uint dynSum( dyn_uint x [, dyn_bool mask] );

float dynSum( dyn_float x [, dyn_bool mask] );

Parameters

Parameter Meaning
x field to be examined
mask masking field

Return Value

In the event of an error -1, otherwise the value with the appropriate data type

Errors

An error message is issued in the event of missing or incorrect arguments.

Description

Returns the sum of the elements of the dynamic field x. The optional argument mask has the same function as in dynMax().

Example

main()
{
  dyn_int di;
  di=makeDynInt(120,1,2,3,4,5,6);
  DebugN("Sum:",dynSum(di)); // 141
}

Assignment

Dynamic fields

Availability

CTRL