argument_count

Returns the number of arguments passed to a script.

Syntax:

argument_count;


Returns: Real


Description

This read-only variable returns the number of "arguments" that are passed through to a script. Normally used in conjunction with an argument array (argument[0...15]) to permit varying input arguments for a given script.


Example:

var i, arg;
for (i = 0; i < 5; i += 1;)
   {
   if argument_count > i
      {
      arg[i] = argument[i]
      }
   else
      {
      arg[i] = -1;
      }
   }

The above code uses the argument_count variable to initialize variables, and is an example of how to permit a script to accept a variable number of arguments.


Back: Scripts
© Copyright YoYo Games Ltd. 2018 All Rights Reserved