Code: Select all
CountProcedureParameter()
ProcedureParameter( ByIndex )
ProcedureParameter( ByName$ )
Code: Select all
CountProcedureParameter()
ProcedureParameter( ByIndex )
ProcedureParameter( ByName$ )
Not really "Self-explanatory". Are these function compiler functions like SizeOf() or Defined() or runtime functions?akee wrote: Tue Jan 09, 2024 3:29 pm Self-explanatory. This would be so helpful in development.
Code: Select all
CountProcedureParameter() ProcedureParameter( ByIndex ) ProcedureParameter( ByName$ )
Code: Select all
Procedure Test(A.i, B.i=-1)
ProcedureReturn CountProcedureParameter()
EndProcedure
Debug Test(7, 8) ; Would return 2, because two parameter are passed.
Debug Test(7) ; Would return 2 as well, because this line is called as Test(2, -1)
Debug Test(7, 8, 9) ; Would raise an error, because not all arguments are defined.
Indeed, it wasn't clear to me either, until we got this, because it essentially ignores all the other information he/she/they/... got by all previous posts and points to the use case of variadic arguments.STARGÅTE wrote: Tue Jan 23, 2024 1:16 pm From the author's title and article it is not obvious that he wants procedures with arbitrary number of arguments.
I thought, ProcedureParameter() is similar to GetRuntimeInteger() or GetRuntimeString() from the Runtime library, just for procedure's arguments.
akee wrote: Tue Jan 23, 2024 9:10 am
This would be one.
https://www.purebasic.fr/english/viewtopic.php?t=83339