Skip to main content
Solved

Can I use tow IF operators in one conditional?

  • June 24, 2023
  • 4 replies
  • 537 views

Julia_Pchelova

I’m going through prototyping playground and I cann’t overcome one condition. I need my #VolumeBar panel to stay red to 450 pixels when it shrinks. But it immediately turns yellow. Because I can’t use the second IF or even AND

Best answer by Thong_Nguyen

You can’t nest IF inside another IF, but you can add another one outside as a second Conditional

This topic has been closed for replies.

4 replies

Thong_Nguyen
  • New Participant
  • 18 replies
  • Answer
  • June 25, 2023

You can’t nest IF inside another IF, but you can add another one outside as a second Conditional


Julia_Pchelova

I also think it’s impossible, not that I didn’t understand the functionality. Thank you!


_Paul1
  • 2 replies
  • June 27, 2023

So, can anybody provide the solution for “Go further…” How to write a condition where the “volumeBar” color changes appropriately? Like the original poster mentioned. For example, if “volumeBar” is at 600 and you select minus, “volumeBar” color should remain RED, but it changes to YELLOW, due to the “else” condition which the original poster shows.

Cheers!


_Paul1
  • 2 replies
  • June 30, 2023

Just figured it out.
As the OP’s Conditional statement.

If “volumeLevel” <= 300
set variable yellow to green
is fine, but leave the “else” statement blank.

I also added to the [-] button,

if “volumeLevel” is >= 450
set variable yellow to red.
else
set variable yellow to yellow

Then, everything worked.