Multiple @ifset in one command?

Is possible to use multiple @ifset modifiers into one button? Anidated @ifsets or a @ifset after another (How to tell Dopus when a @ifset is end?)
Ex.
@ifset:DUAL=On
set dual=On
@ifset:else
set dual=Off
Now here how to tell DOpus that this ifset is over?
@ifset:VIEWPANE=On
Set Dual=Off
@ifset:else
Set Dual={$dual}

Or one @ifset inside other?

You can't nest @ifsets, but you can use @ifset:common to end a group.

Command Modifier Reference has an example.

This seems to be related to my current task. As far as I understand @ifset can not be nested but as long as the groups are closed by @ifset:common they can be put in a sequence one after each other. I gave that a quick try with two closed blocks in a sequence and actually it seems to work very well providing a lot more flexibility in variable checking.

Thus I started to adapt my "source-display-maximize" command a little bit to handle the case when the right file display initially has the focus. In this case a Go SWAP needs to be performed in the end after restoring the view elements.

I simply add an internal variable that should trigger the Go SWAP at the end and put three if-else-common groups in a sequence. Strangely only group 1 and 2 are correctly evaluated but the debug dialog in group 3 does never appear (should at least show TRUE or FALSE).

Is there any obvious error? Thanks in advance for any help!

@toggle:if $glob:SourceMaximized

// if-else-common group ONE

@ifset:FOCUS=right
    @set glob:FocusRight=on  // remember that right file display has focus (could only occur on first call)
@ifset:else
@ifset:common

// if-else-common group TWO

@ifset:$glob:SourceMaximized
    @set glob:SourceMaximized
    Set TREE=on DUAL=on,remember METAPANE=on VIEWPANE=on
    @set SwapNeeded={$glob:FocusRight}  // delay display swapping to the end of the command
    @set glob:FocusRight
@ifset:else
    @set glob:SourceMaximized=on
    Set TREE=off DUAL=off METAPANE=off VIEWPANE=off UTILITY=off
@ifset:common

// if-else-common group THREE

@ifset:$SwapNeeded
    @set nonsense={dlgstring|TRUE}
    Go SWAP
@ifset:else
    @set nonsense={dlgstring|FALSE}
@ifset:common

This is what scripting is for. Please use it.

For debugging these kind of buttons, the "Say" command is quite helpful: Command: SetVar (set, toggle, delete vars from anywhere)).

As a side note, yes, Leo is right. o)
The downside of the scripting is, that it can get quite verbose very quickly. I think there's something missing in between. Something that features a syntax as easy to use as the regular button codes and as powerful as the full scripting object-model.

Actually I tend to use commands for simple tasks whenever it is possible. Particurlarly if the command engine provides everything you need to reach your goal with just a few lines of code. Unfortunately in my example above the problem is the visibility of the changed variable that is used in the third if-then-common block. It seems that it isn't refreshed. But anyway I will follow Leo's suggestion and write a script for that.

Thank you so much tbone for pointing me to these Say and SetVar scripts. They are definitely useful.

Pseudo-nested conditional statements via variables is both verbose and complex. For simplicity and terseness, you're really better using scripting here, which is designed for that kind of thing, than building similar flow-control using commands, which aren't really designed for it beyond very simple cases.

This kind of thing is quite easy with scripts, and only gets easier the more you do it. It's the best way forward. :slight_smile:

(Edit: I see from the other thread you converted it into a nice script, so my advice is moot now. :slight_smile: Looks like a good script, too. Pretty much how I would have written it.)

Actually I alread did that. Sometimes if there is a command that already provides 95% of my wishlist I'm willing to take a little more complexity into account just to save time. But you are right I started hacking around, thus I spend more time to do it right. :wink:

I wanna see that too, what thread do you refer to? o))

This script maximizes / minimizes the current source pane.

Thanks! o)

Is it avatar changing time, the spring coming? What's going on? Sasa and you look different sudenly.. o)

:slight_smile: