This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Loop Condition not getting satisfied when the variable value is set through GEL script

I am trying to run a gel script from where I am setting value of a variable to be true so that the "if" loop condition in source code is satisfied.

Below is the code snippet:  (where true is a enum member with value 1)

//----------------------------------

if (valid == true)
{

if (newPosition == true)
{
 newPosition = false;
CommandActionResetFlg = true;
}

UpdateCommand();
}
else
{
 newPosition = true;
}

//-------------------------------

Though the GEL script, I want to satisfy the first if condition i.e. (valid == true);

So, I am setting valid =1; (i.e true) in the GEL script just before this condition.

While debugging its showing value of valid as true (condition satisfied), though the condition is still failing;

Pl. suggest.