 |
THE HYPERCARD CENTER |
|
|
Note: This is a work in progress and many formatting issues have been fixed. Read more about the project on the home page.
averageaverage(numberList)
Value returned: number equal to the arithmetic average of the comma-separated list of numbers Examplesaverage(1,2,3,4,5,6,7,8,9,10) repeat with N = 1 the number of lines of field "Number Data" put line N of field "Number Data" into item N of theNumbers end repeat put average(theNumbers)
Demo Scripton onAverage repeat with numLine = 1 to the number of lines of me put the number of words of line numLine of me into¬ item numLine of wordsInEachLine end repeat put "There are an average of" && average(wordsInEachLine) && ¬ "words in each line of this field." into sayIt answer sayIt end onAverage
Related Topics Placeholders
numberListA 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
|