Link to home
Start Free TrialLog in
Avatar of rmmarsh
rmmarshFlag for United States of America

asked on

What's wrong with this statement? (objective-c, a superset of C)

what's wrong with this statement? sysLangCode is equal to "ja"... statement fails and executes the "else" statements

if(sysLangCode == @"en" ||
sysLangCode == @"de" ||
sysLangCode == @"it" ||
sysLangCode == @"es" ||
sysLangCode == @"fr" ||
sysLangCode == @"ja" ||
sysLangCode == @"zh-Hant") {
    statements to be executed if true
}
else {
   exec if false
}
Avatar of theras2000
theras2000
Flag of United States of America image

Based on my previous knowledge and some forums I just googled, I think you need to nest these conditions in multiple if statements like
if (sysLanCode == a)
  if (sysLanCode == b) etc. etc.

An if statement is looking for a single result of TRUE or FALSE; 1 or 0.
Currently your if statement is computing as if (0 or 0 or 0 or 0 or 1 or 0 or 0) which it doesn't understand.  You need it to simply qualify as if(1) or if(0).
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rmmarsh

ASKER

Thank you, thank you, thank you!  I have spent over 2.5 hours on this, and you hit it on the head!