Need help with some coding.
This is what i have:
*if ((((Gender = "Male") or (Gender = "Female")) and (((background = "suburbs") and ((kind > funny) or (kind > mean))))
This is my error:
“Invalid expression, expected CLOSE_PARENTHESIS”
Need help with some coding.
This is what i have:
*if ((((Gender = "Male") or (Gender = "Female")) and (((background = "suburbs") and ((kind > funny) or (kind > mean))))
This is my error:
“Invalid expression, expected CLOSE_PARENTHESIS”
Try
*if (((blah) and (blah2)) and (blah3))
Thanks for the quick response
But would that work with “or” as well?
Yes, that should work with or as well.
I tried it:
*if (((Gender = "Male") or (Gender = "Female")) and (background = "suburbs") and (kind > funny) or (kind > mean))
and i got this:
“Invalid expression at char 76, expected CLOSE_PARENTHESIS, was: NAMED_OPERATOR [and]”
Try:
*if((Gender=“Male”) or ((Gender=“Female”) and (background=“suburbs”)) and ((kind > funny) or (kind>mean)))
Right, with four variables it’s a bit different–takes some getting used to! I do my best to avoid four, actually, because the parenthesis get nutty.
Thanks for helping out too
I did as you said:
*if ((Gender = "Male") or ((Gender = "Female") and (background = "suburbs")) and ((kind > funny or kind > mean)))
I got the same error:
“Invalid expression at char 76, expected CLOSE_PARENTHESIS, was: NAMED_OPERATOR [and]”
I know, but i have no idea how to do make it easier. I’m kind of new to this too.
I got the first right:
*if (((Gender = "Male") and (background = "village")) and ((mean > kind) or (mean > funny)))
I don’t think it gave me an error…
I forgot “(” and “)” in a few places, edited it just now, sorry, I’m on the phone so it’s tricky to write a code
No worries friend! I appreciate the help you’re giving.
The coding is like this now:
*if ((Gender = "Male") or ((Gender = "Female") and (background = "suburbs")) and ((kind > funny) or (kind > mean)))
And it seems i got the same error:
“Invalid expression at char 76, expected CLOSE_PARENTHESIS, was: NAMED_OPERATOR [and”
Does this work?
*if (((Gender = “Male”) or (Gender = “Female”)) and (background = “suburbs”)) and ((kind > funny) or (kind > mean))
Otherwise, it really depends on what exactly are the units you’re using. For future reference, though, it can only handle two units at a time so what I like to do is bracket off the “or” parts first and combine them into one unit each, and then start bracketing the “and” statements together.
IT WORKED! Thank you so much! <3
I would hug you if i could!
Maaan, i love this community…
Hope this helps. Read down for an example combining ands with ors…
Thank you so much for the reply, though I’ve already solved it thanks to some amazing people.
But thank you really for the explanation, I understand this better now!