integral Posted February 17, 2012 Group: Members Topic Count: 51 Topics Per Day: 0.01 Content Count: 167 Reputation: 4 Joined: 02/01/12 Last Seen: August 20, 2017 Share 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 Link to comment Share on other sites More sharing options...
Gepard Posted February 17, 2012 Group: Members Topic Count: 22 Topics Per Day: 0.00 Content Count: 392 Reputation: 285 Joined: 12/19/11 Last Seen: January 23, 2022 Share 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 Link to comment Share on other sites More sharing options...
integral Posted February 17, 2012 Group: Members Topic Count: 51 Topics Per Day: 0.01 Content Count: 167 Reputation: 4 Joined: 02/01/12 Last Seen: August 20, 2017 Author Share 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 Link to comment Share on other sites More sharing options...
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 integralLink to comment
Share on other sites
2 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.