Home THE HYPERCARD CENTER

HyperTalk Reference
Home » HyperTalk Reference » Functions

Note: This is a work in progress and will be formatting errors. 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}


« stackSpace | HyperTalk Reference | systemVersion »


Version 0.7b1 (March 24, 2022)

Made with Macintosh

Switch to Modern View

Home
The HyperCard Center
HyperTalk Reference
Home » HyperTalk Reference » Functions

Note: This is a work in progress and will be formatting errors. 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}


« stackSpace | HyperTalk Reference | systemVersion »

Version 0.7b1 (March 24, 2022)

Made with Macintosh

Switch to Retro View