I have a question regarding sorting and ignoring articles.
Is it possible to use a script to "get" the current sort state (ie: column and ascending/descending), including if the sort is ignoring articles?
Thanks in advance for any help
Ignore articles when sorting
Ignore articles when sorting
Windows 10 Pro 22H2
Re: Ignore articles when sorting
Sure, the
get
command knows the sort state and savesettings
(to a temp .ini file to not overwrite the current one) updates the pane.ini file(s) which you can get the key Style
in the section ListBrowse
from via getkey
and then you only need to look at viewtopic.php?t=12999 and use its "expand" part to check if the bit flag for 32768 (= Ignore Articles When Sorting) is set...One of my scripts helped you out? Please donate via Paypal
Re: Ignore articles when sorting
Thanks a lot highend, I've gotten this far:highend wrote: ↑14 Oct 2021 09:27 Sure, theget
command knows the sort state andsavesettings
(to a temp .ini file to not overwrite the current one) updates the pane.ini file(s) which you can get the keyStyle
in the sectionListBrowse
from viagetkey
and then you only need to look at viewtopic.php?t=12999 and use its "expand" part to check if the bit flag for 32768 (= Ignore Articles When Sorting) is set...
"the
get
command knows the sort state"My code:
get("Sort", [pane=a]);
"
savesettings
(to a temp .ini file to not overwrite the current one) updates the pane.ini file(s)"My code:
savesettings, "xyplorer_temp.ini";
"get the key
Style
in the section ListBrowse
from via getkey
"My code:
getkey("Style", "ListBrowse", "<xypane>\pane.ini");
"then you only need to look at viewtopic.php?t=12999 and use its "expand" part to check if the bit flag for 32768 (= Ignore Articles When Sorting) is set"
I'm sorry but I don't understand how to "use its "expand" part". In fact, I confess I barely understand any of that script.
Followup questions:
1. What am I supposed to do with the result of
getkey
?2. Is there any way to do this without saving the settings? Yes, it updates the pane.ini files but that overwrites saved tabsets and changes their settings.
Windows 10 Pro 22H2
Re: Ignore articles when sorting
Code: Select all
get("Sort", [pane=a]);
Code: Select all
getkey("Style", "ListBrowse", "<xypane>\pane.ini");
The last part of it isn't that hard to understand. It's only two loops. One to find the maximum number of bits and the second one that checks if a specific bit is set or not. The dereferencing (to create variables out of the values) isn't necessary. And you need the "is bit 16 (= 32768) set or not", otherwise you don't know if "Ignore Articles When Sorting" is active or not...In fact, I confess I barely understand any of that script
If you don't do it, you won't get the current value of "Ignore Articles When Sorting" so it's your decision if you do it like this or notIs there any way to do this without saving the settings?
One of my scripts helped you out? Please donate via Paypal
Re: Ignore articles when sorting
"That's nonsense... Menu - Scripting - [x] Syntax checking^^"highend wrote: ↑15 Oct 2021 01:06That's nonsense... Menu - Scripting - [x] Syntax checking^^Code: Select all
get("Sort", [pane=a]);
What's the use of both of these if you don't assign the result to a variable to be able to do something with them?Code: Select all
getkey("Style", "ListBrowse", "<xypane>\pane.ini");
The last part of it isn't that hard to understand. It's only two loops. One to find the maximum number of bits and the second one that checks if a specific bit is set or not. The dereferencing (to create variables out of the values) isn't necessary. And you need the "is bit 16 (= 32768) set or not", otherwise you don't know if "Ignore Articles When Sorting" is active or not...In fact, I confess I barely understand any of that script
If you don't do it, you won't get the current value of "Ignore Articles When Sorting" so it's your decision if you do it like this or notIs there any way to do this without saving the settings?
Not really nonsense. I just hadn't gotten around to removing the unnecessary code and it worked so I wasn't too bothered for now. But here ya go, just for you:
Code: Select all
$a = get("Sort");
No, I hadn't gotten around to that either but, again, here ya go, just for you:
Code: Select all
$b = getkey("Style", "ListBrowse", "<xypane>\pane.ini");
Maybe not hard for you but it's not helpful to assume it shouldn't be hard for someone else.
"It's only two loops. One to find the maximum number of bits and the second one that checks if a specific bit is set or not. The dereferencing (to create variables out of the values) isn't necessary. And you need the "is bit 16 (= 32768) set or not", otherwise you don't know if "Ignore Articles When Sorting" is active or not..."
Sorry, still don't understand any of that.
"If you don't do it, you won't get the current value of "Ignore Articles When Sorting"
I thought that might be the case.
It's all irrelevant now, anyway. I can't do what I was hoping to do. I hadn't looked into it enough and it doesn't work the way I thought it would. But at least I learnt a little bit about get() and getkey() so thanks for that.
Windows 10 Pro 22H2
Re: Ignore articles when sorting
Maybe post a feature request for
Ofc in a subfolder named "Panes" relative to the path of
This wouldn't break existing behavior and should be fairly easy to add / accomplish by Don...
savesettings
to allow it to save the panes in the folder of the [ini]
file?Ofc in a subfolder named "Panes" relative to the path of
[ini]
(internally resolved).This wouldn't break existing behavior and should be fairly easy to add / accomplish by Don...
One of my scripts helped you out? Please donate via Paypal