Updated November 2016; see History
.ARGCNT holds the number of arguments for the last SBX or function or procedure. It also:
• retrieves the number of arguments passed to an SBX, without any need to ++INCLUDE ASHINC:XCALL.BSI previously.
• returns -1 if the current program was not called as an SBX.
• gets replaced by the next Function, Procedure or SBX call, so it should be tested immediately at the start of a routine, and the results saved if needed later in the routine.
History
2016 November, A-Shell 6.3.1534, compiler edit 790: use of .ARGCNT within a PRIVATE_BEGIN / PRIVATE_END block now generates a compile error. Although the expression wouldn't technically be illegal, because the PRIVATE block is essentially called for initialization by whatever function or procedure in the module gets called first, there's really no good way to predict in advance what the .ARGCNT value will represent, and thus it is almost certain to create a discrepancy between the expected and actual behavior.
2012 November, A-Shell 6.0.1262: The current .ARGCNT value (# of arguments passed to the current subroutine, function or procedure) is no longer wiped out by calls to functions or procedures. This eliminates the need to copy it to a local variable immediately upon entrance into a routine.