Jump to content
  • 0

if(select(...


Question

2 answers to this question

Recommended Posts

Posted

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 :)

  • Upvote 1
Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...