Discussion:
loop exiting problem PLEASE HELP
(too old to reply)
Marko
2007-07-14 18:23:44 UTC
Permalink
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?
Ed Mulroy [TeamB]
2007-07-14 18:41:59 UTC
Permalink
Please post any given question only in the one group most related to the
subject of the question.

See my reply to your duplicate message in the language.cpp group.

. Ed
Loading...