Function PCount() Foundation
Determines the number of arguments passed to a function or procedure.
PCount() --> nArgumentCount
The return value of PCount() is a numeric value indicating the number of arguments passed during the call of a function or procedure (the number of arguments which the function or procedure has received). When a function or procedure has no formal parameters or when no arguments are passed, PCount() returns the value zero.
PCount() returns the number of arguments passed to a function or procedure. This can be used to determine whether optional arguments at the end of the argument list are included. If only the third argument is passed to a function with three arguments, PCount() returns the value 3 and the first two arguments are initialized with the value NIL.
As an example, in the call var := TESTFUNC(,,) the value NIL is passed three times to the function TESTFUNC(). Within TESTFUNC() PCount() returns the value 3.
If arguments are missing within the argument list, their value can be compared to NIL or the data type of the arguments can be determined with the function Valtype(). Missing arguments have the value NIL and a data type identified by Valtype() == "U" (undefined).
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.