function average()
{
var items = average.arguments.length;
var sum = 0;
for (i = 0; i < items;i++)
{
sum += average.arguments[i];
}
return sum / items;
}
If you put this in a script object called MathUtils you can call it using;
MathUtils.average(1,2,3);
You can pass as many arguments as you like.
I generally use JavaScript myself but feel I should point out that FormCalc does have an inbuild Avg function