UNSOLVED

knakawa

updated

11 years ago

K

knakawa

11 Posts

0

745

April 1st, 2015 17:00

if statement with OR

Hi,

I'm trying to get if statement to compare against mutiple strings in one statement but it is failing for some reason. (Verified the statement to be working seperately without using || )

deviceObj = object(eventObj->OccurredOn);

   if (!deviceObj->isNull()){

   if (deviceObj->PrimaryOwnerContact == "P2" || deviceObj->PrimaryOwnerContact == "P2test " ){

   eventObj->Severity = 2;

   eventObj->changed();

   }

although the following works fine

deviceObj = object(eventObj->OccurredOn);

   if (!deviceObj->isNull()){

   if (deviceObj->PrimaryOwnerContact == "P2" ){

   eventObj->Severity = 2;

   eventObj->changed();

   }

any suggestion?