# sum() function

The sum() function 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.

## Syntax

```
sum(str.exp)
```

## Parameter(s)

| str.exp | List of numbers, delimited by attribute, value, or subvalue marks, from which the sum is calculated. |
| --- | --- |

## Description

The sum() function supports string math.

## Example(s)

The result, `6.2`, displays on the terminal.

```
crt sum(3:@am:3.2)
```
The result, `6.2^8`, prints because sum recognizes that there were two lists present, separated
by an attribute mark.

```
print sum(3:@vm:3.2:@am:6:@vm:2)
```

## See also

- [*= assignment operator](https://d3codex.com/pickbasic-flashbasic/asterisk-equals-assignment-operator/)
- [+ arithmetic operator](https://d3codex.com/pickbasic-flashbasic/plus-arithmetic-operator/)
- [+= assignment operator](https://d3codex.com/pickbasic-flashbasic/plus-equals-assignment-operator/)
- [-= assignment operator](https://d3codex.com/pickbasic-flashbasic/minus-equals-assignment-operator/)
- [/= assignment operator](https://d3codex.com/pickbasic-flashbasic/slash-equals-assignment-operator/)
- [:= assignment operator](https://d3codex.com/pickbasic-flashbasic/colon-equals-assignment-operator/)
- [FlashBASIC C functions overview](https://d3codex.com/pickbasic-flashbasic/flashbasic-c-functions-overview/)
- [\= assignment operator](https://d3codex.com/pickbasic-flashbasic/backslash-equals-assignment-operator/)

---
Source: https://d3codex.com/pickbasic-flashbasic/sum-function/ - part of the D3Codex reference.
