gayathri_gopi
06-17-2004, 07:47 AM
I have a if else statement, like below.
This code in a C# code.
iFlag=0;
if (iFlag==0)
{
MessageBox.Show(""+iFlag);
iFlag=2;
}
else
{
iFlag=0;
}
I have kept the code in a timer_tick event
Time is set for 500ms.
for the first tiem of the timer tick event, both the statements in the true part is executing, but , for the second time and all only the second statement i.e iFlag=2 is only executing.,a nd MessageBox.Show is skipped.
Even if i have any statement in that place, only the second statement is executed.
Can anybody please help me out.
I am mad to see this work like this.
Sometimes,
if i keep only 1 statement in the true and the else part, both the statements are executed.
It is not showing me any errors, if there are some braces problem.
please can anybody help me.
This code in a C# code.
iFlag=0;
if (iFlag==0)
{
MessageBox.Show(""+iFlag);
iFlag=2;
}
else
{
iFlag=0;
}
I have kept the code in a timer_tick event
Time is set for 500ms.
for the first tiem of the timer tick event, both the statements in the true part is executing, but , for the second time and all only the second statement i.e iFlag=2 is only executing.,a nd MessageBox.Show is skipped.
Even if i have any statement in that place, only the second statement is executed.
Can anybody please help me out.
I am mad to see this work like this.
Sometimes,
if i keep only 1 statement in the true and the else part, both the statements are executed.
It is not showing me any errors, if there are some braces problem.
please can anybody help me.