argument_count

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

 

Syntax:

argument_count;

 

Returns:

Real

 

Example:

function print(){
    var _str = "";
    for (var i = 0; i < argument_count; i ++)
    {
        _str += string(argument[i]);
    }
    show_debug_message(_str);
}

// In an object
print("Player : ", current_time, " : ", id, " : fired");

The above function joins all the arguments passed into the function as one string, and then prints that string to the output log.