Re: [PHP] Recursion... Sort of...

2008-05-09 Thread tedd
At 5:48 PM -0400 5/8/08, Matt Neimeyer wrote: Is there a way to tell if a function has been called that has resulted in a call to the same function? We have an in-house CRM app that has a function that draws a tabbed panel on a screen... BUT if there are sub-sub-tabbed panels we want to invert t

Re: [PHP] Recursion... Sort of...

2008-05-09 Thread Matt Neimeyer
Wow! Thanks guys! Here's what I ended up doing... To get... Black on White - 1 White on Black - 2 Black on White - 3 Black on White - 3 White on Black - 2 Black on White - 3 I had to do something like... function doStuff() { static $callCount = 0; $callCount++; if($c

Re: [PHP] Recursion... Sort of...

2008-05-09 Thread Nathan Nobbe
On Fri, May 9, 2008 at 1:52 AM, Stut <[EMAIL PROTECTED]> wrote: > On 9 May 2008, at 02:02, Nathan Nobbe wrote: > >> function doStuff() { >> static $callCount; >> >> if(!isset($callCount)) >> $callCount = 1; >> else >> $callCount++; >> >> /// do stuff w/ $callCount to potentially handle sub-tabs

Re: [PHP] Recursion... Sort of...

2008-05-09 Thread Stut
On 9 May 2008, at 02:02, Nathan Nobbe wrote: function doStuff() { static $callCount; if(!isset($callCount)) $callCount = 1; else $callCount++; /// do stuff w/ $callCount to potentially handle sub-tabs and stuff if($callCount == 2) { echo 'white on black'; } else { echo 'black

Re: [PHP] Recursion... Sort of...

2008-05-08 Thread Nathan Nobbe
On Thu, May 8, 2008 at 6:23 PM, Jim Lucas <[EMAIL PROTECTED]> wrote: > Nathan Nobbe wrote: > >> On Thu, May 8, 2008 at 3:48 PM, Matt Neimeyer <[EMAIL PROTECTED]> wrote: >> >> Is there a way to tell if a function has been called that has resulted >>> in a call to the same function? >>> >>> We have

Re: [PHP] Recursion... Sort of...

2008-05-08 Thread David Otton
2008/5/8 Matt Neimeyer <[EMAIL PROTECTED]>: > Is there a way to tell if a function has been called that has resulted > in a call to the same function? debug_backtrace() Can't comment on performance, though. Its an inelegant solution. > We have an in-house CRM app that has a function that draws

Re: [PHP] Recursion... Sort of...

2008-05-08 Thread Jim Lucas
Nathan Nobbe wrote: On Thu, May 8, 2008 at 3:48 PM, Matt Neimeyer <[EMAIL PROTECTED]> wrote: Is there a way to tell if a function has been called that has resulted in a call to the same function? We have an in-house CRM app that has a function that draws a tabbed panel on a screen... BUT if th

Re: [PHP] Recursion... Sort of...

2008-05-08 Thread Nathan Nobbe
On Thu, May 8, 2008 at 3:48 PM, Matt Neimeyer <[EMAIL PROTECTED]> wrote: > Is there a way to tell if a function has been called that has resulted > in a call to the same function? > > We have an in-house CRM app that has a function that draws a tabbed > panel on a screen... BUT if there are sub-su