Is there a shorted “if / then” syntax available in Lua (I’m using Corona SDK specifically), like in some other languages… In particular along the lines of:
res = (a == b) ? "It worked" : "It did NOT work"
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To represent
x = a ? b : c, the lua-users wiki suggests:To represent
x = a ? b : c ? d : e, the wiki further suggests:WARNING: This technique may fail if
bordare evernilorfalse.