There are a few ways that if statements can work together.
It’s possible to nest if statements into other if statements. This means that the ‘then’ part of your if statement triggers another ‘if’.
‘IF [value] is greater than 70, THEN IF [value] is less than 80, THEN IF [run action]’
Then, there’s ‘else if’. ‘Else if’ tells the computer that when the ‘if’ condition is false, it needs to trigger another if statement to determine what to do next.
‘IF an incoming email contains ‘invoice’, THEN forward to [email address], ELSEIF the incoming email does not contain an attachment, THEN add to junk mail.’
If statements also interact separately from each other.
For example, one of your if statements sends some incoming data from your email to the correct database. Then, another of your if state
It’s possible to nest if statements into other if statements. This means that the ‘then’ part of your if statement triggers another ‘if’.
‘IF [value] is greater than 70, THEN IF [value] is less than 80, THEN IF [run action]’
Then, there’s ‘else if’. ‘Else if’ tells the computer that when the ‘if’ condition is false, it needs to trigger another if statement to determine what to do next.
‘IF an incoming email contains ‘invoice’, THEN forward to [email address], ELSEIF the incoming email does not contain an attachment, THEN add to junk mail.’
If statements also interact separately from each other.
For example, one of your if statements sends some incoming data from your email to the correct database. Then, another of your if state
ments checks your database for new entries and runs actions on the results.
No comments:
Post a Comment