Minor scripting related wishes (a generic thread)

Features wanted...
TheQwerty
Posts: 4353
Joined: 03 Aug 2007 22:30

Re: Minor scripting related wishes (a generic thread)

Post by TheQwerty »

SammaySarkar wrote:Hiiiy, it's me with another wish!
PHP7's new combined comparison operator <=> can be pretty nice!

Code: Select all

// operator <=>
  text compare(1, 2);
  text compare(4, 3);
  text compare(5, 5);

function compare($a, $b) {
  return ($a > $b) ? 1 : ( ($a < $b) ? -1 : 0 ) ;
}
:veryconfused:
XY already has a compare SC, so are you just suggesting the addition of the spaceship (<=>) operator?

Though, I suppose it's a bit more since compare() requires you to specify a method whereas this operator would presumably use the same logic as the existing comparison operators when deciding if the values are strings or numbers.

(Not a vote for or against just a pursuit for clarity.)

SammaySarkar
Posts: 4235
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Minor scripting related wishes (a generic thread)

Post by SammaySarkar »

Yes, wishing for the operator only.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

admin
Site Admin
Posts: 50609
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: Minor scripting related wishes (a generic thread)

Post by admin »

I read about it but failed to find convincing real world examples for the use of it.
FAQ | XY News RSS | XY Twitter | Stay home! 🎸 Or wear a mask! 😷

SammaySarkar
Posts: 4235
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Minor scripting related wishes (a generic thread)

Post by SammaySarkar »

It's the SPACESHIP operator, you don't need real-world examples! :P
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

admin
Site Admin
Posts: 50609
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: Minor scripting related wishes (a generic thread)

Post by admin »

:lol: :tup:
FAQ | XY News RSS | XY Twitter | Stay home! 🎸 Or wear a mask! 😷

zer0
Posts: 2673
Joined: 19 Jan 2009 20:11

Re: Minor scripting related wishes (a generic thread)

Post by zer0 »

Where the displayed SC is truncated by the width of the menu that is shown -- for example, where moveto() paths are quite long and exceed the boundary -- being able to see the whole path on mouseover of that SC would be quite useful. Thanks.
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

admin
Site Admin
Posts: 50609
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: Minor scripting related wishes (a generic thread)

Post by admin »

zer0 wrote:Where the displayed SC is truncated by the width of the menu that is shown -- for example, where moveto() paths are quite long and exceed the boundary -- being able to see the whole path on mouseover of that SC would be quite useful. Thanks.
Agreed but not possible.
FAQ | XY News RSS | XY Twitter | Stay home! 🎸 Or wear a mask! 😷

zer0
Posts: 2673
Joined: 19 Jan 2009 20:11

Re: Minor scripting related wishes (a generic thread)

Post by zer0 »

admin wrote:
zer0 wrote:Where the displayed SC is truncated by the width of the menu that is shown -- for example, where moveto() paths are quite long and exceed the boundary -- being able to see the whole path on mouseover of that SC would be quite useful. Thanks.
Agreed but not possible.
Would it be possible to enable full paths to be shown instead?
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

admin
Site Admin
Posts: 50609
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: Minor scripting related wishes (a generic thread)

Post by admin »

Got a screenshot of what you mean? Not sure what menu you are talking about.
FAQ | XY News RSS | XY Twitter | Stay home! 🎸 Or wear a mask! 😷

zer0
Posts: 2673
Joined: 19 Jan 2009 20:11

Re: Minor scripting related wishes (a generic thread)

Post by zer0 »

admin wrote:Got a screenshot of what you mean? Not sure what menu you are talking about.
Here you go...I would like for the menu to be dynamic in terms of width and display the full paths that are currently truncated
Image
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

sheeeple
Posts: 13
Joined: 08 Aug 2016 17:31

Re: Minor scripting related wishes (a generic thread)

Post by sheeeple »

Hi, sorry if this had been brought up already. I've searched but I couldn't find anything related.

Would it be possible to have Xyplorer provide a list of extensions of certain file types using the visual filter syntax eg. "{:Video}".
Maybe something like:

Code: Select all

    get("{:Video}", $separator="|", $excludedExts); // returns a list of extensions of video files
This would remove the need to define the file extensions during scripting (eg. $videoExts = "mp4|wmv|flv";) whenever we have to do something which checks for the extension.
It would also be awesome if you allowed the user to add their own Categories(eg. 'Comic Archives', 'Disc Images', 'i'm sure there are others xD') in the Configuration screen instead of being restricted to whats configurable on the 'Previewed Formats' settings.

highend
Posts: 10053
Joined: 06 Feb 2011 00:33

Re: Minor scripting related wishes (a generic thread)

Post by highend »

viewtopic.php?p=121180#p121180

Code: Select all

get("genericfiletype", "{:Video}", ",");
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

sheeeple
Posts: 13
Joined: 08 Aug 2016 17:31

Re: Minor scripting related wishes (a generic thread)

Post by sheeeple »

highend wrote:viewtopic.php?p=121180#p121180

Code: Select all

get("genericfiletype", "{:Video}", ",");
:oops: Thanks

admin
Site Admin
Posts: 50609
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: Minor scripting related wishes (a generic thread)

Post by admin »

zer0 wrote:
admin wrote:Got a screenshot of what you mean? Not sure what menu you are talking about.
Here you go...I would like for the menu to be dynamic in terms of width and display the full paths that are currently truncated
Image
Where does this menu come from?
FAQ | XY News RSS | XY Twitter | Stay home! 🎸 Or wear a mask! 😷

zer0
Posts: 2673
Joined: 19 Jan 2009 20:11

Re: Minor scripting related wishes (a generic thread)

Post by zer0 »

admin wrote:Where does this menu come from?
From a custom "Run Script" UDC.
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

Post Reply