Functions

paramCount

Supported By

Syntax

the paramCount

paramCount ()

Example

if the paramCount < 3 then ¬
  put "I need at least three arguments."

Description

The paramCount function returns the number of parameters passed to the currently executing handler.

Script

The following example multiplies the arguments passed to it, regardless of how many there are. In other words, it is functionally equivalent to the product function:

function theProduct
  put 1 into total
  repeat with i = 1 to the paramCount
    multiply total by param(i)
  end repeat
  return total
end theProduct

See Also

param, params