Home THE HYPERCARD CENTER

HyperTalk Reference
Home » HyperTalk Reference »

Note: This is a work in progress and many formatting issues have been fixed. Read more about the project on the home page.

sum

sum(numberList)

Value returned: the sum of a comma-delimited list of items

numberList evaluates to a comma-delimited list of items, including any container holding such a list.

Examples

put sum(field 5) into total
if sum(firstList) > sum(secondList) then answer "Imbalance Found"

Demo Script

on mouseUp
answer "1 + 2 + 3 + 4 + 5 + 6 + 7 =" && sum(1,2,3,four,5,6,7)
end mouseUp

Placeholders

numberList

A comma-separated list of numbers.

1,2,3,4,5
"1.2,2.2,3.2"

In AppleScript, the list must be enclosed in brackets:

{1,2,3,4,5}

HyperTalk Reference


Version 0.8b4 (July 4, 2025)

Made with Macintosh

Switch to Modern View