S06013

Error Code

S06013

Error Message

As long as one parameter sets a default value, all following parameters must set default values. RefId: S06013

Probable Causes

When defining a function, once a parameter is given a default value, all parameters that follow must also be assigned default values; otherwise, this error occurs.

For example, an error may arise in the following script because parameter "b" is given a default value while "c" that follow is not.

def f(a, b=1, c) {
}

Solutions

  • Put the parameter with a default value at the end of the parameter list.

  • Assign default values to all parameters following the first parameter with a default value

def f(a, c, b=1) { // Put "b" at the end of the parameter list
}

def f(a, b=1, c=2) { // Assign a default value to "c" that follows "b"
}