Click to See Complete Forum and Search --> : Going into another function from one function


Ravi Sangisetti
June 1st, 1999, 12:12 PM
I need to jump into the body of a function from another function. How can I make it?. Pls help me as it is very essential to me.

Ravi Sangisetti
Sr.Software Engineer
Contech India Ltd
Gandinagar, India

June 1st, 1999, 12:30 PM
jumping into the body of another function does not sound like something very nice to do, is it possible to structure the function you want to "jump into" into smaller functions and then just call the function pieces that you need?

Ravi Sangisetti
June 1st, 1999, 01:08 PM
Thanks for your suggestion. But let me make the problem clear.

1. In a function

RunFunction()
{

DTL_WRITE(int x, 1000)
//some thing to execute after above instru
...
...

}




This DTL_WRITE is a function given by a particular software. It should perform this operation with in one second. But some times it is getting hanged for infinite time. As the function is supplied by another vendor, we can not do any thing in that.
So I am using a timer Event for checking whether this function was over by 1 second or not. If not I want to execute the instruction next to DTL_WRITE. But as it is hanged there, it is not possible.
So Though I want to maintain structural model, this peccular situation put me in dilema. Pls help me.

Ravi Sangisetti
Sr.Software Engineer
Contech India Ltd
Gandinagar, India

June 1st, 1999, 03:59 PM
RunFunction()
{
DTL_WRITE(int x, 1000);
NewFunction();
}

FuncCalledFromTimerEvent
{
NewFunction();
}

NewFunction()
{
// some thing to execute after above instru
}

was what I was getting at - is this app multi-threaded, or how are you getting timer event messages after DLT_WRITE hangs?

Ravi Sangisetti
June 2nd, 1999, 10:17 AM
Thanks a lot for your suggestion. Yes. I am using multithreading. With Ur suggestion, I could solve that problem.

Thank U very much

Ravi Sangisetti
Sr.Software Engineer
Contech India Ltd
Gandinagar, India