- the base function's actual parameter count; or
- the number of remaining unbound parameters (up to the variadic for variadic functions).
Code: Select all
f(a, b, c, d*)
{
}
f := Func('f')
MsgBox f.MaxParams ; 3, expected 3(A) or 3(B). Correct. Function not bound yet.
f := f.Bind('a')
MsgBox f.MaxParams ; 0, expected 3(A) or 2(B)
f := f.Bind('b')
MsgBox f.MaxParams ; 0, expected 3(A) or 1(B)
f := f.Bind('c')
MsgBox f.MaxParams ; 0, expected 3(A) or 0(B)
*Having it always return 0 is not particularly useful. I heavily doubt this was a conscious design decision.
Other methods (such as IsOptional() behave similarly. This evidently stems from the fact that they query the BoundFunc interface instead of the underlying function's. Again, not particularly useful.