Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Artful Two for Clipper 5.0 - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

Syntax

ASUM( aArray[, nStart[, nStop ]] )

Purpose

Sum the elements in a numeric array, optionally for a contiguous segment of
the array (from nStart to nStop).

Arguments

     aArray -- array whose elements are to be summed

     nStart -- if passed, element to start at, else 1

     nStop -- if passed, element to stop at, else last one

Setup

The array must be declared and filled with numeric elements.

Example

     LOCAL array := { 10, 12, 14, 16 }

     ? ASUM( array )                     && returns 52
     ? ASUM( array, NIL, 3 )             && returns 36
     ? ASUM( array, 3 )                  && returns 30

Returns

The sum of the array elements from nStart to nStop inclusive.

Side Effects

Any undefined or non-numeric elements will crash the program.

Artful Calls

None.

Source File

AA_ASUM.PRG

See Also: AAVG() AMIN() AMAX()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson