integral Posted February 17, 2012 Posted February 17, 2012 (edited) What's the difference between these two? if(select("Yes:No") - 1) if(select("Yes:No")== 1) What's the - 1/ == 1 for? Thank you. Edited February 17, 2012 by integral Quote
Gepard Posted February 17, 2012 Posted February 17, 2012 select returns the number of chosen option, starting with 1 (in this case it's 1 for Yes and 2 for No). if clause is entered if the condition in it does not evealuate to 0, or is not false == compares two expressions and returns true if they're equal - 1 substracts 1 from the expression So, first example, Yes will yield if-condition equal 0, so if clause will not be entered, and No will yield if-condition equal 1, so if clause will be entered. In second example, you probably know already what will happen 1 Quote
integral Posted February 17, 2012 Author Posted February 17, 2012 if clause is entered if the expression in it does not equal 0 Sorry, I wasn't able to get this part... select returns the number of chosen option, starting with 1 (in this case it's 1 for Yes and 2 for No). if clause is entered if the condition in it does not evealuate to 0, or is not false == compares two expressions and returns true if they're equal - 1 substracts 1 from the expression So, first example, Yes will yield if-condition equal 0, so if clause will not be entered, and No will yield if-condition equal 1, so if clause will be entered. In second example, you probably know already what will happen Oh... I see, alright. Thank you. Problem Solved. Quote
Question
integral
What's the difference between these two?
if(select("Yes:No") - 1)
if(select("Yes:No")== 1)
What's the - 1/ == 1 for?
Thank you.
Edited by integral2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.