Click to See Complete Forum and Search --> : question about holding a value in recursion


SGSpecialK
April 26th, 2003, 05:42 AM
Hi all,
I have and insert function that calls a bool recursive function. In the recursive function I call a split function. I need something to happen if the split function was called at any time in the recursive function so that i could use it in an if statement in the insert function. For example,
*this isn't exact code or anything just an example*
insert
{
calls bool pushDown
if(split happened)
do something
}


pushDown
{
if(blah blah)
.....return false
else
....//result is bool
result = pushDown()
bunch of if's and elses
split()
}

I don't think that cleared anything up much, but i just need proof that spit happened so that in insert i can use that to do something else. Any clue?

rxbagain
April 26th, 2003, 06:13 AM
You can add global variable to serve as flag if spit happens.

Hope this will help you.

SGSpecialK
April 26th, 2003, 03:15 PM
YES! thank you I don't know why I didn't think of that! THANKS

Mick
April 26th, 2003, 03:52 PM
Originally posted by SGSpecialK
YES! thank you I don't know why I didn't think of that! THANKS


eww globals...stop right there...try a static var and return code.