# SUM

Updated: 10/19/2021, 9:29:48 PM
Created: 10/19/2021, 9:29:48 PM
Last Updated By: Kevin Munoz
Read Time: 1 minute(s)

# Description

The SUM function sums numeric elements in a dynamic array. It takes the general form:

SUM(expr)
1

Where:

expr is a dynamic array. Non-numeric sub-values, values and attributes are ignored.

An example of use is as:

a0 = 1 : @SVM : 2 : @VM : 3 : @AM : 4 : @SVM : 5 : @VM : 6 : @AM : 7 : @SVM : 8 : @VM :'NINE'

a1 = SUM (a0)
a2 = SUM(a1)
a3 = SUM(a2)

CRT a0
CRT a1
CRT a2
CRT a3
1
2
3
4
5
6
7
8
9
10

to display:

1³2²3�4³5²6�7³8²NINE
3²3�9²6�15²0
6�15�15
36
1
2
3
4

Go back to jBASE BASIC

Go back to Programmers' Reference Guide