The following function returns the mean average of all the parameters passed to it, skipping any with a null value:

function mean( )

   local nRet, nArg, nCnt 

   nTot = 0 

   nCnt = 0 

   for nArg = 1 to argcount( ) 

      if argvector( nArg ) # null 

         nTot += argvector( nArg ) 

         nCnt++ 

      endif 

   endfor 

 return nTot / nCnt