Hey,
I'm going to ask a couple of question. You can lie back on a couch now if you wish.
1) What becomes of $unitstake? I know that may not be important so don't bother answering if you don't want to.
2) I'm not following 100%, but I gather you want singlecalc() to return your total if that first condition is met. Is this correct? If that's the case, why not do something like
But then that brings us back to the first question. Is $unitstake supposed to be some kind of global? Same with $stake? I don't see mention of either of these two anywhere else in the function.
Now this may not be warranted, but here goes. Why not do something like...
Code: Select all
if(condition1==true)
{ $total=singlecalc($args); }
else
{ $total=doublecalc($args); }
Also, all of those args that are passed to singlecalc() (one of which I just noticed is $stake
DOH !) except for $odds1 and $odds1a are coming from where? If you don't include these are args in the original function declaration, make them globals.
Anyways, since $unitstake is important in some way, doing things the way I suggested may be easier as you don't have to worry about returning $total
AND $unitstake from the function. It can be done, but's easier as above. Just tweak it a little as such...
Code: Select all
if(condition1==true)
{
$total=singlecalc($args);
$unitstake=$stake;
}
else
{ $total=doublecalc($args); }
Anyways, I hope the rambling gives you some ideas. I'm not a code God or anything. Check Volka or Twig for that.
Cheers,
BDKR