Thanks for the response! Here is the code for the while loop. "each" is combined with $errMess==" " :
while (($errMess == "") &&
(list(,$val) = each($tokenArr)))
{
$this->log->notice(sprintf($SearchEngineConst['TokenInSequenceMsg'],$val["item"]));
if ($val["type"] == "operand")
{
$this->log->notice(sprintf($SearchEngineConst['OperandPushedToArrayMsg'],$val["item"]));
$tableName = getOrigTmpName();
if ($val["UnaryOp"] == "")
{
if (preg_match("/^\{(.*)\}$/",$val["item"],$arr))
{
$val["item"] = $arr[1];
$this->getSelection($val["item"],$path,"folder",$tableName,$errMess);
}
else
{
$this->getSelection($val["item"],$path,"word",$tableName,$errMess);
}
}
else
{
if (preg_match("/^\{(.*)\}$/",$val["item"],$arr))
{
$val["item"] = $arr[1];
$this->getNotSelection($val["item"],$path,"folder",$tableName,$errMess);
}
else
{
$this->getNotSelection($val["item"],$path,"word",$tableName,$errMess);
}
}
if ($errMess == "")
{
$val["item"] = $tableName;
array_push($operandStack,$val);
}
}
else if ($val["type"] == "operator")
{
$op1 = array_pop($operandStack);
$op2 = array_pop($operandStack);
if (($op1 == NULL) || ($op2 == NULL))
{
$errMess = $errMessPrefix.$SearchEngineConst['EmptyOperandStackErrMsg'];
$this->log->error($errMess);
}
if ($errMess == "")
{
$this->log->notice(sprintf($SearchEngineConst['ExecuteOperationMsg'],$val[item]));
$this->log->notice(sprintf($SearchEngineConst['OperationInfoMsg'],$op1,$val[item],$op2));
$this->executeOperation($op1,$op2,$val["item"],$resOperand,$errMess); // old: $this->executeOperation($op1,$op2,$val["item"],&$resOperand,$errMess);
}
if ($errMess == "")
{
$this->log->notice(sprintf($SearchEngineConst['OperationResultMsg'],$resOperand[item]));
array_push($operandStack,$resOperand);
}
}
else
{
$errMess = $errMessPrefix.sprintf($SearchEngineConst['TokenTypeUnknownErrMsg'],$val[type]);
$this->log->error($errMess);
}
} //END WHILE LOOP