rmmarsh
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
}
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
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you, thank you, thank you! I have spent over 2.5 hours on this, and you hit it on the head!
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).