Picture of IF Statements with Else and Else IF in Invent | IV_Logic_013

IF Statements with Else and Else IF in Invent | IV_Logic_013

This segment explains the use of "else if" statements to handle scenarios with multiple conditions and actions. Unlike a simple "if-else" statement, where only two outcomes are possible, "else if" allows for multiple different scenarios to be addressed. The example given includes various options like selecting a logo, brand, and logo color, which necessitates multiple conditions and actions. The explanation details how to set up these "else if" conditions, emphasizing that each condition is paired with a specific action, and always ending with a final "else" to cover any conditions not previously addressed. This ensures all possible scenarios are accounted for in the logic flow.

Tutorial Video Transcript

A transcript of our tutorial video, ensuring you can find exactly what you need, when you need it.

You can search this page to find the relevant time-stamp in the video. Also, this text can be used as part of the tutorial search feature.

00:00:09:13 - 00:00:10:21
And the final option here.

00:00:10:21 - 00:00:14:25
The final general thing to show
is this else and else.

00:00:15:06 - 00:00:20:06
If so, I've shown you else
as in the the alternate condition.

00:00:20:23 - 00:00:23:09
But what if there's multiple different
scenarios?

00:00:23:09 - 00:00:26:03
There's not just sort of like it
can be this or this.

00:00:26:03 - 00:00:29:25
In many situations
it can be multiple different options,

00:00:29:25 - 00:00:33:08
especially when you have a few different
variables that's associated with.

00:00:34:14 - 00:00:37:01
So I've got some examples here.

00:00:37:01 - 00:00:39:06
Keep your eye on this box
here with the else and else.

00:00:39:06 - 00:00:43:08
If what we've got is a box which is do

00:00:43:08 - 00:00:45:23
you want a logo a box
which you select the.

00:00:45:23 - 00:00:46:14
So brand.

00:00:46:14 - 00:00:49:14
So either just in figure
or the vehicle Academy

00:00:49:25 - 00:00:52:25
and then select the logo color
so it can be full color or white.

00:00:53:13 - 00:00:56:20
Now this is multiple different conditions
associated with each other.

00:00:56:21 - 00:01:01:20
So just one yes or no
solution is not going to really cut it.

00:01:02:23 - 00:01:04:22
So if I start playing around with those
you can see there's

00:01:04:22 - 00:01:07:22
a lot of different potential
things that this can be.

00:01:10:23 - 00:01:13:23
And the way in which we make those.

00:01:15:21 - 00:01:16:11
This is where the

00:01:16:11 - 00:01:19:16
if statements start to get a little bit
more lengthy when you're creating them.

00:01:20:04 - 00:01:24:19
So we start by specifying our initial
if conditions and actions.

00:01:25:06 - 00:01:27:06
But then instead of just clicking.

00:01:27:06 - 00:01:31:12
So if I scroll down to the bottom of this
now instead of just clicking add else

00:01:31:12 - 00:01:34:12
which is the last statement,

00:01:34:20 - 00:01:37:20
we instead say add else if and.

00:01:37:20 - 00:01:41:03
This allows us
to put in an additional configuration

00:01:41:03 - 00:01:44:03
with a new set of conditions
and a new set of actions.

00:01:44:23 - 00:01:47:25
Just remember that we'll always need
an else right at the end.

00:01:47:25 - 00:01:50:28
Just sort of close out the statement
for any conditions

00:01:50:28 - 00:01:54:01
that have not been covered
in the previous statements.

00:01:55:10 - 00:01:57:13
So if
we start to look at what this is doing,

00:01:57:13 - 00:02:01:16
we've got our initial
if conditions and actions else

00:02:01:16 - 00:02:05:07
if that covers
a different set of conditions

00:02:05:07 - 00:02:09:20
and then resulting actions, more else
ifs, more else ifs

00:02:09:28 - 00:02:13:10
and then else to finish it and sort of
round out the entire statement.

00:02:16:12 - 00:02:16:28
So you can see

00:02:16:28 - 00:02:20:02
the basic methodology
is still exactly the same.

00:02:20:02 - 00:02:22:24
You're still creating
just conditions and actions.

00:02:22:24 - 00:02:27:09
But when you start to get more complicated
conditions, it starts to get a bit

00:02:27:09 - 00:02:30:09
more of a lengthy process
to start to put these together.

 

Incomplete
Guide unavailable