example of a simple function to find the average of all its paramters

proc   average
local   j   acc

if   argcnt() != 0   then

acc   =   0

for   j=0   while   j<argcnt()   step   j+=1   do

// get parameter j via the arg operator @
acc   +=   @j
done

return   float(acc) / argcnt()

endif

// return invalid value
return

endproc

using the average function

a   =   average(x,  y)

a   =   average()

a   =   average("25",  17,  1,  -27,  x,  2.5)