Marko
2007-07-14 18:23:44 UTC
hello
i have a problem with loop exit operation
there is a for loop in my software i need to terminate by SpeedButton
my loop looks like this (for example)
for(int i=0; i<2500; i++)
{
if(continue==false) break; //exit from the loop on request
//other RS232 operations
}
im seting the "continue" variable to false state by clicking a SpeedButton
void __fastcall TForm1::SpeedButtonSTOPClick(TObject *Sender)
{
continue=false; //continue is a global variable
}
but.... while a loop is running i can't change the "continue" variable.
my software is busy ... the SpeedButtonSTOPClick function is called just
after that (but it's too late)
how to solve this problem?
i have a problem with loop exit operation
there is a for loop in my software i need to terminate by SpeedButton
my loop looks like this (for example)
for(int i=0; i<2500; i++)
{
if(continue==false) break; //exit from the loop on request
//other RS232 operations
}
im seting the "continue" variable to false state by clicking a SpeedButton
void __fastcall TForm1::SpeedButtonSTOPClick(TObject *Sender)
{
continue=false; //continue is a global variable
}
but.... while a loop is running i can't change the "continue" variable.
my software is busy ... the SpeedButtonSTOPClick function is called just
after that (but it's too late)
how to solve this problem?