Quote:
Originally Posted by ehha
How can i do this?
PHP Code:
public function_mean( some_int, some_float, ... ) { //bla }
What index would the other parameters have?
|
PHP Code:
public function_mean( some_int, Float:some_float, ... )
{
//some_int is considered parameter 0
//some_float is considered parameter 1
//therefore the next parameter would start at 2
}
It should also be noted that you can tag the dynamic arguments in order to prevent tag mismatch warnings.
PHP Code:
public function_mean( Float:... )
{
// You need to pass the first 2 arguments as float values or else this calculation
// Will be messed up
// Also the third parameter is a integer (normal value)
setarg(2, floatround((Float:getarg(1)+Float:getarg(0)) / 2.0))
}