Selpos: Questions.

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Selpos: Questions.

Post by SkyFrontier »

This little script was working up to 9.70.0011 (and helped me much for the last days):

Code: Select all

   $t = ("<curbase>");
   copytext $t;
   selpos +1; //currently "sel"
   status "$t";
...but not working since .0017. No changes that I'm aware of. Is there any way to get it back to track? At least a workaround?
Thanks!
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Selpos: Questions.

Post by TheQwerty »

http://www.xyplorer.com/xyfc/viewtopic. ... 727#p54727

Code: Select all

v9.70.0017 - 2010-11-15 15:18
    ! Scripting: Unary operators + and - were not always parsed
      correctly. Fixed. Now stuff like this works:
        ::echo 1 + --1; //2
        ::echo --(1 * ----2); //2
Thus now when the parser reads:

Code: Select all

selpos +1;
It first evaluates "+1" to "1" and then the selpos, meaning it is the same as:

Code: Select all

selpos 1;
To restore the old behavior just put the +1 in quotes:

Code: Select all

   $t = ("<curbase>");
   copytext $t;
   sel '+1';
   status "$t";

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: Selpos: Questions.

Post by SkyFrontier »

I've tried some stuff related to:

Code: Select all

v6.80.0070 - 2008-02-11 22:07
...
    + Scripting commands enhanced:
      - new
        Added a 4th optional parameter "r":
        Syntax: new name, [file|dir], [source], [r]
          r = invoke rename mode after creation
        So, the new default now is to NOT invoke rename mode.
      - selpos (now: sel)
        Renamed it to "sel" (selpos still works), and added a new 
        selection method by pattern, and a new optional argument 
        "count".
        Syntax: sel (position)|("pattern")|a|i|f|, [count=1]
        - "pattern": If the argument is quoted the next (below current 
          position) matching item is selected. Note that it does not wrap 
          around to the top of the list when the bottom is reached.
          Pattern can have wildcards * (0 or more chars), ? (1 char), 
          and # (1 number). To match the character "#" you have to state 
          "[#]" in the pattern. It's the same rules as in Find Files.
        - count: If any item was selected then "count" items are 
          selected starting with the first item. If omitted, count 
          defaults to 1. If set to zero, the sel command can be used to 
          move the focus in a list with no selections.
        Examples:
          ::sel ""*hi*"", 3
            Selects the next file below the current position that 
            matches "*hi*". If no match is found all selections are 
            removed. If there is a match, the this item and the next 2 
            are selected.
          ::sel +6, 6
            Selects six-packs of files one after the other.
          ::sel +1, 0
            Moves the focus to the next position, but does not select.
          ::sel 12, 0
            Moves the focus to position 12 (or o the last if less items 
            in list), but does not select.
...of course I've got nothing.
Plus, this is a 6.80.0070 change and as I've mentioned the "problem" went with +.0017.
Tested and fixed. Thank you very much, TheQwerty!
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

Post Reply