Question about sel

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
zakhar
Posts: 179
Joined: 08 Sep 2010 21:13

Question about sel

Post by zakhar »

Hello, Forum!

I observe some strange behavior of sel command. Don't know, is it a bug or something else, or even normal?
Concretely:
In the folder content list we can see a long list of folders, more longer as 100 folders. I want to pick out a folder using sel:

Code: Select all

sel "[folder100-*]";
-> List view goes deep down and the folder with the name "folder100-*" can now be seen as it is emphasized by a white shadow and frame.
Now I go deeper with the command

Code: Select all

sel "[folder200-*]";
-> Same effect - all ok.
But now I want to go up in the list view to the folder Nr. 195 - it is only 5 folders above the 200. folder and
can be seen in the current view, I also want it to be emphasized:

Code: Select all

sel "[folder195-*]";
-> The 195. folder - contrary to my expectation - does not became emphasized :( Why?
This happens with all folders that are residing above the folder Nr. 200 of this example.
Not the number of the current folder does matter, but something else.

PeterH
Posts: 2830
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Question about sel

Post by PeterH »

Reading help on sel it says: "starting on current position".

But specyfying the 3rd parameter as 1 says: "start from top of list".

zakhar
Posts: 179
Joined: 08 Sep 2010 21:13

Re: Question about sel

Post by zakhar »

Well, the problem can be solved by adding "sel 1;" before "sel "[folder195-*]";" :

Code: Select all

sel 1;
sel "[folder195-*]";
So each time I use "sel" command for the described purpose I must premise "sel 1;" .
Strange, I think there must be a way to achieve what I have meant in my first post by one command.

PeterH
Posts: 2830
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Question about sel

Post by PeterH »

Seems you didn't (try to?) understand what I wrote?

So:

Code: Select all

   sel "[folder195-*]", , 1;
should do what you want. Help says for 3rd operand of sel:
0: start from current list position (that's the default)
1: start from top of list

In your current situation it seems you should always use this form.

That is: reading Help can help :wink:

zakhar
Posts: 179
Joined: 08 Sep 2010 21:13

Re: Question about sel

Post by zakhar »

PeterH wrote: 25 Oct 2018 22:23 Seems you didn't (try to?) understand what I wrote?
You have right, I really did not understand your answer.
I have read in the XYplorer's help file about the "startfromtop" command parameter before and after you posted your answer,
but it was insufficient for me too. That is why I started this topic here. :|
I decided to ask my question here to save time of hopeless experiments.
So do not be angry and thank you! ;)

PeterH
Posts: 2830
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Question about sel

Post by PeterH »

I'm not angry. :D

But: did you understand it now?

zakhar
Posts: 179
Joined: 08 Sep 2010 21:13

Re: Question about sel

Post by zakhar »

PeterH wrote: 25 Oct 2018 23:04 But: did you understand it now?
Yes.
Some commands like "sel "[folder195-*]", , 1;" are now integrated in my scripts in the catalog and
they work as I expect them to work.

The sentence "startfromtop is ignored if the first argument is not a pattern." from the help file
should be replaced by one without double negation :) : "startfromtop works if the first argument is a pattern."
Sonst ist der Satz für mich hirnrissig ;) and not only for me, I think.

PeterH
Posts: 2830
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Question about sel

Post by PeterH »

OK: fine :tup: :cup:

Post Reply