Author Topic: Convert "Begin" to "Else If" action and vice-versa  (Read 2254 times)

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Convert "Begin" to "Else If" action and vice-versa
« on: November 29, 2017, 06:45:44 AM »
I often find myself creating conditional statements that would usually be implemented in a switch/case block, I.E. each branch checks the same input in turn, to see if it matches that specific condition.

E.G.
Code: [Select]
Begin Integer Compare : [1] Equals 1
Else If Integer Compare : [1] Equals 2
Else If Integer Compare : [1] Equals 3
End Condition

In addition, when a comparison has a logical order to it, I prefer to maintain that order when adding branches to the condition; E.G. if I wanted to check whether "1" equals "0", I'd put that at the top, changing the current "Begin" action into a "Else If" action(Likewise when removing the top branch, the first "Else If" action must be made into a "Begin" action).


Currently, either of these operations requires manually creating a "Begin" and "Else If" block separately from scratch, which can be time consuming, especially when using the condition builder.

As both actions take the exact same parameters, a context menu entry to "Change to Else If action" and "Change to Begin action" the "Begin" and "Else If" actions respectively, would make both of the above operations much less labor intensive.


EDIT: As the dropdown to change between actions within an action configuration dialog is no longer available (which is what TheThingIs was referring to as a workaround), this request gains relevance.
« Last Edit: April 18, 2020, 09:32:21 AM by Pfeil »

TheThingIs

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 278
    • HCS Voicepacks
Re: Convert "Begin" to "Else If" action and vice-versa
« Reply #1 on: November 29, 2017, 03:22:07 PM »
you can do this already for single conditions. If you edit the line you can change it by using Select a special action. So you can change them to begin or else or elseif without losing the context of the condition.

Compound conditions you can't do this so a simpler method as Pfeil is suggesting which works for both would be helpful indeed.
The Singularity profile - One profile to rule them all and at HCS we bound them ;)

You see, TheThingIs, eventually you'll be allright.