basic.sum

Function/BASIC Program, Releases: AP 5.2

Returns the sum of a list of numbers

Syntax

sum(string.expression)

Description

returns the sum of a list of numbers delimited by attribute, value, or subvalue marks. If different orders of marks are present, the 'sum' function computes the sum of each sublist.

Example

equ am to char(254)
print sum(3:am:3.2)

The result, '6.2', will be printed to the terminal.

equ am to char(254), vm to char(253)
print sum(3:vm:3.2:am:6:vm:2)

The result, '6.2^8', prints because 'sum' senses that there
were two lists present, separated by an attribute mark.

See Also

Command Name Type Description
basic.functions Definition elements in FlashBASIC or Pick/BASIC language expressions, returning a single value in place, as a function of the arguments. A function can be used anywhere a variable or expression is used.
basic.*= Assignment Operator Multiplies numeric expression and assigns to variable.
basic.+= Assignment Operator Adds numeric expression and assigns to variable.
basic.-= Assignment Operator Subtracts numeric expression and assigns to variable.
basic./= Assignment Operator Divides numeric expression and assigns to variable.
basic.:= Assignment Operator Concatenates expression and assigns to variable.
basic.+ Operator Arithmetic operator (add). Also unary plus.

User Comments

What do you think?

Share your experience or ask a question by using the form below.

Login to leave your comments.