Page 1 of 2

Get Dual Pane mode?

Posted: 09 Nov 2010 04:21
by EnjoyRC
Is it possible to return the current mode in scripting? Is dual pane toggled on or off? I've tried returning the get("Item",1) commands. But even if dual pane is toggled off, Pane 2 still returns the path.

I'm looking to script turning on Dual Pane if it's off and setting both paths.

I know toggling it is #800; //Toggle Dual Panes

But before toggling, I need to know if it's on or off. Else if I #800; I may be turning it off.

Re: Get Dual Pane mode?

Posted: 09 Nov 2010 06:05
by admin
Hi and welcome,

I added something experimentally. In the next BETA try this:

Code: Select all

echo state(800);

Re: Get Dual Pane mode?

Posted: 09 Nov 2010 10:12
by admin
admin wrote:Hi and welcome,

I added something experimentally. In the next BETA try this:

Code: Select all

echo state(800);
Forget this, I got something better:

Code: Select all

text get("#800", "DP", "SP");

Re: Get Dual Pane mode?

Posted: 09 Nov 2010 13:30
by EnjoyRC
admin wrote:Forget this, I got something better:

Code: Select all

text get("#800", "DP", "SP");
Works Perfectly! You rock!

Code: Select all

    $p = get("#800", "DP", "SP");
    if $p == "SP" {
        #800;  //Toggle Dual Panes
    }
By the way, thank you for your ultra-quick responses. What a great product, and seeing that support is awesome for XYplorer makes me that much more confident in my purchase!

Re: Get Dual Pane mode?

Posted: 09 Nov 2010 13:47
by admin
Tip: If you don't need the labels for display you can also use this shorter version:

Code: Select all

    if get("#800") == "1" {
        #800;  //Toggle Dual Panes
    }

Re: Get Dual Pane mode?

Posted: 09 Nov 2010 14:14
by EnjoyRC
admin wrote:Tip: If you don't need the labels for display you can also use this shorter version:

Code: Select all

    if get("#800") == "1" {
        #800;  //Toggle Dual Panes
    }
Nice... you're right. I didn't need the defined variable. I love efficient code.

Re: Get Dual Pane mode?

Posted: 09 Nov 2010 14:28
by admin
Whoops, I showed you bad (but working) syntax. The expression after if *should* be in parentheses:

Code: Select all

    if (get("#800") == "1") {
        #800;  //Toggle Dual Panes
    }

Re: Get Dual Pane mode?

Posted: 09 Nov 2010 14:37
by EnjoyRC
admin wrote:Whoops, I showed you bad (but working) syntax. The expression after if *should* be in parentheses:

Code: Select all

    if (get("#800") == "1") {
        #800;  //Toggle Dual Panes
    }
Mine was working without them. But single pane = "0", dual pane = "1". I wanted to insure dual pane was active.

Re: Get Dual Pane mode?

Posted: 09 Nov 2010 14:39
by TheQwerty
If only we had a not-operator then you could make it:

Code: Select all

if (! get('#800')) {
  #800;
}
If only... :cry: :wink:

Re: Get Dual Pane mode?

Posted: 09 Nov 2010 14:44
by admin
EnjoyRC wrote:
admin wrote:Whoops, I showed you bad (but working) syntax. The expression after if *should* be in parentheses:

Code: Select all

    if (get("#800") == "1") {
        #800;  //Toggle Dual Panes
    }
Mine was working without them. But single pane = "0", dual pane = "1". I wanted to insure dual pane was active.
Aaah, sure! :roll: :oops: (Didn't have much sleep tonite.)

Re: Get Dual Pane mode?

Posted: 09 Nov 2010 14:48
by EnjoyRC
admin wrote:Aaah, sure! :roll: :oops: (Didn't have much sleep tonite.)
MakeCoffee; 8)

Re: Get Dual Pane mode?

Posted: 09 Nov 2010 15:10
by admin
TheQwerty wrote:If only we had a not-operator then you could make it:

Code: Select all

if (! get('#800')) {
  #800;
}
If only... :cry: :wink:
Try next version. :wink: (No time to document it...)

PS: All this should work in 9.70.0005... looks like I got it. :D

Code: Select all

if (!get('#800')) {
  #800;
}
if (! get('#800')) {
  #800;
}
if (not get('#800')) {
  #800;
}
if (not not not get('#800')) {
  #800;
}

Re: Get Dual Pane mode?

Posted: 09 Nov 2010 16:15
by EnjoyRC
admin wrote:PS: All this should work in 9.70.0005... looks like I got it. :D
How cool! :!:

Re: Get Dual Pane mode?

Posted: 09 Nov 2010 17:08
by j_c_hallgren
EnjoyRC wrote:By the way, thank you for your ultra-quick responses. What a great product, and seeing that support is awesome for XYplorer makes me that much more confident in my purchase!
That's why we LOVE Don and XY SO much! Sounds like a good quote for Don to use on site if possible.

Re: Get Dual Pane mode?

Posted: 10 Nov 2010 15:00
by TheQwerty
admin wrote:
TheQwerty wrote:If only we had a not-operator then you could make it:

Code: Select all

if (! get('#800')) {
  #800;
}
If only... :cry: :wink:
Try next version. :wink: (No time to document it...)

PS: All this should work in 9.70.0005... looks like I got it. :D
I had expected that this would also work:

Code: Select all

$a = 'a';
  if (! "$a" Like "") {
    echo 'hi';
  }
Not a deal breaker since it seems to work with parens:

Code: Select all

$a = 'a';
  if (! ("$a" Like "")) {
    echo 'hi';
  }