Re: Unknown number of incoming parameters



On 2005-08-01 03-28-09 Luthor <Luthor <bbrunno3000@xxxxxxxxx>> wrote:
> say I have a function foo() and the number of incoming parameters could
> conceivably be random.
>
> For example, foo() could be called w/ 0 params, and sometimes it could be
> called w/ 9 parameters. I know C does this, but is there a way to trap this
> w/o using foo(array( param1=>x....})
>
> in C, the function declaration is something to the effect of foo(...)
>
> Thanks

http://de3.php.net/manual/en/function.func-num-args.php and the other
functions mentioned ("See also") should help you.

HTH,
Simon
--
Simon Stienen <http://slashlife.org/>
"What you do in this world is a matter of no consequence,
The question is, what can you make people believe that you have done."
/Sherlock Holmes in A Study in Scarlet by Sir Arthur Conan Doyle/
.



Relevant Pages

  • Re: Warnings in lcc-win
    ... Any function declaration that specifies the types of the ... arguments is a prototype, whether it's part of a definition or not. ... void bar{foo();} ... void bar() ...
    (comp.lang.c)
  • newbie - let and lamda problem
    ... (define [foo x y] ... params for the procedure to run. ...
    (comp.lang.scheme)
  • Re: Function definition
    ... Now I've tried putting the function declaration after the call but the ... def a: ... return 'foo' ... module-level statements can't call functions defined below them because ...
    (comp.lang.python)
  • Re: struct foo and function foo !?
    ... > in the same scope can have the same name. ... In C, foo wouldn't be a type, struct foo ... a function declaration or definition will hide the name ...
    (comp.lang.cpp)
  • Re: Invoking python functions from TCL XMLRPC client
    ... What is the correct way to pass a parameter to TCL such that when foo ... some other type with '' after it) or as 'array' (for a generic array ...
    (comp.lang.tcl)