RPTools

From MapToolDoc

argCount

Contents

argCount() Function

Introduced in version 1.3b51

The argCount() function is used to determine the number of arguments that have been passed to a user defined function. User functions are defined with the defineFunction(), once you have defined the function you can call it is you would call any of the existing functions. You can then use the argCount() function to determine how many arguments were passed when it was called.

Once the number of arguments have been determined you can use arg() to retrieve them.

Usage

  1. argCount()

Example

An example of a simple macro that would be defined as a user defined function. This function will add together all of the arguments that are passed to it.

  1. [h: numArgs = argCount()]
  2. [h: total = 0]
  3. [h,count(numArgs): total = total + arg(roll.count)]
  4. [r: total]

See Also

defineFunction(), isFunctionDefined(), arg()