Help forum

Simplest / Cleanest way to set a multiple condition

  • Jehex

    2 years ago

    Hi there, I would like to know the simplest way to set a multiple condition, let's said
    I would like to set a specific value to a global variable depending the value of my input variable

    like if resolution = 1 then width = 1024
    if else resolution = 2 then width = 1156
    if else resolution = 3 then width = 1216

    Thanks you
    1286964619704926268-Untcitled.png
  • Andreas Møller

    2 years ago

    1286966144632094730-CleanShot_2024-09-21_at_10.23.472x.png
  • @Andreas Møller

    Jehex

    2 years ago

    Thanks a lot Andreas, didnt know we can use object for this case! 😄
  • Andreas Møller

    2 years ago

    It’s a nice trick. Object are often called Maps in other languages because they “map” from one value to another other
  • Jehex

    2 years ago

    Perfect,clear and clean 😄