In AutoHotKey the way to see how many command line arguments are provided is %0%. This works well sometimes, however in the example below when it is part of a string concatenation it doesn't return the number of arguments. Instead it returns the last argument's value.
MsgBox %0% ; here is does show the number of arguments
MsgBox %1% ; and the contents of the first one...
MsgBox %2% ; second one...
MsgBox %3% ; third one...
STRING := %0%
MsgBox %STRING% ; this should be the number of
; arguments but instead it is
; the last argument
exit
If you simply change the line
STRING := %0%
toSTRING = %0%
, you will get the desired result.