Average function

Tom Vawter tvawter at austincc.edu
Sun Jan 28 14:49:01 EST 2007


>on mouseUp
>    put long id of fld 1 & cr & long id of fld 2 & cr & long id of fld 3 \
>        into pFieldList
>    answer nonemtpyAverage(pFieldList)
>end mouseUp
>
>
>function nonemtpyAverage pFieldList
>    put 0 into N
>    put 0 into tTotal
>    repeat for each line tField in pFieldList
>        get value( tField )
>        if it <> "" then
>            add it to tTotal
>            add 1 to N
>        end if
>    end repeat
>    return tTotal/N
>end nonemtpyAverage
Very good, Scott.  Thanks.

Tom Vawter




More information about the use-livecode mailing list