"Item Count" property for CCs?
"Item Count" property for CCs?
Hi Don,
If possible, please consider adding an "Item Count" special property for CCs... I'm referring to this thing from the Tree and List settings.
I tried using "File Count" but that is apparently something different.
What I'd like to is make a Mixed Column that is
IF image >> Dimensions
ELSE IF folder >> Item Count
ELSE >> Size.
Thanks. (This is a low-priority item--just something for your todo list )
Also just an FYI, I noticed that when making a "Folder Only" CC, XYplorer automatically added the *.* to the filter section.
Should it be an /*/ instead (??)
If possible, please consider adding an "Item Count" special property for CCs... I'm referring to this thing from the Tree and List settings.
I tried using "File Count" but that is apparently something different.
What I'd like to is make a Mixed Column that is
IF image >> Dimensions
ELSE IF folder >> Item Count
ELSE >> Size.
Thanks. (This is a low-priority item--just something for your todo list )
Also just an FYI, I noticed that when making a "Folder Only" CC, XYplorer automatically added the *.* to the filter section.
Should it be an /*/ instead (??)
ste(phen|ve) kunkel
-
- Site Admin
- Posts: 60632
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: "Item Count" property for CCs?
Count: too slow, man!
*.* : good point!
*.* : good point!
FAQ | XY News RSS | XY Twitter
Re: "Item Count" property for CCs?
Even though counting the contents of folders could really slow things down with large directories... I still think it would be a worthy capability. What I would find really helpful is if number of subfolders and number of files could be shown. For example in this (bogus) shot:
Maybe some of our script gurus can suggest how to script this??
Maybe some of our script gurus can suggest how to script this??
ste(phen|ve) kunkel
-
- Posts: 2341
- Joined: 04 Jan 2010 14:27
- Location: Pasárgada (eu vou!)
Re: "Item Count" property for CCs?
Cool idea!
edit: yes, it takes some time to get a huge system folder drawn by using this. But it's cool, anyway!
Code: Select all
$tst = "<cc_isfolder>";
if("$tst" == "0") { }
elseif("$tst" == "1") {
$files = trim(folderreport("files", "r", "<cc_item>", ""), "<crlf>");
$dirs = trim(folderreport("dirs", "r", "<cc_item>", ""), "<crlf>");
$files = gettoken("$files", count, "<crlf>");
$dirs = gettoken("$dirs", count, "<crlf>");
return "Files: $files, Dirs: $dirs";
}
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...
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...
Re: "Item Count" property for CCs?
Thanks Sky!
It works like a charm.
As you say (and as Don warned) it is quite sluggish if there are a hundred folders... But if there are only 10 or so, it's nearly instantaneous!
Incidentally, I now need help integrating it into a Mixed CC... But I'll post that as a different thread.
It works like a charm.
As you say (and as Don warned) it is quite sluggish if there are a hundred folders... But if there are only 10 or so, it's nearly instantaneous!
Incidentally, I now need help integrating it into a Mixed CC... But I'll post that as a different thread.
ste(phen|ve) kunkel
-
- Site Admin
- Posts: 60632
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: "Item Count" property for CCs?
Two remarks on style:
Why not simply this?
No need to quote variables. This is fine:
Why not simply this?
Code: Select all
if (<cc_isfolder> == 1) {
Code: Select all
$files = gettoken($files, count, <crlf>);
FAQ | XY News RSS | XY Twitter
Re: "Item Count" property for CCs?
Just to verify: count is a string, isn't it? Even in Help examples show count quoted as "count".admin wrote:No need to quote variables. This is fine:Code: Select all
$files = gettoken($files, count, <crlf>);
So does use count unquoted just work, or is it really correct syntax?
(At least there seems to be no remark saying that it's allowed.)
By the way: in help:
- gettoken() shows all operands as quoted - in Syntay as well as in Examples, while
- gettokenindex() shows operands quoted in Examples, while in Syntax separator and flags are shown unquoted...
(Sometimes users use a strange way of quoting )
Win11 Pro 223H2 Gerrman
-
- Site Admin
- Posts: 60632
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: "Item Count" property for CCs?
Argh, of course you are right!
Code: Select all
$files = gettoken($files, "count", <crlf>);
FAQ | XY News RSS | XY Twitter
-
- Site Admin
- Posts: 60632
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: "Item Count" property for CCs?
Well, I think that's okay to show it unquoted in the syntax. Saves space, and ultimately the climate.PeterH wrote:By the way: in help:
- gettoken() shows all operands as quoted - in Syntay as well as in Examples, while
- gettokenindex() shows operands quoted in Examples, while in Syntax separator and flags are shown unquoted...
(Sometimes users use a strange way of quoting )
FAQ | XY News RSS | XY Twitter
-
- Posts: 2341
- Joined: 04 Jan 2010 14:27
- Location: Pasárgada (eu vou!)
Re: "Item Count" property for CCs?
I've read somewhere that unquoted stuff could lead to unexpected results and quoting would make the scripts future-proof.
Can't say for sure if that was referring to attributing values to variables, though.
Thanks for the advices, guys.
(since it'll save me lots of typing, just hope I don't regret on this as I did with the commands deprecation cascade... )
Can't say for sure if that was referring to attributing values to variables, though.
Thanks for the advices, guys.
(since it'll save me lots of typing, just hope I don't regret on this as I did with the commands deprecation cascade... )
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...
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...
-
- Site Admin
- Posts: 60632
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: "Item Count" property for CCs?
Don't worry. AFAIK no programming language in the world forces you to quote variables.
FAQ | XY News RSS | XY Twitter
Re: "Item Count" property for CCs?
I'd think a small misunderstandig :-)SkyFrontier wrote:I've read somewhere that unquoted stuff could lead to unexpected results ...
It's not "unquoted stuff" but "unquoted strings"!
Strings have to be quoted, variables not. But: variables *may* appear inside of quotes, so instead of
Code: Select all
$d = "string = '" . $str . "'!";
Code: Select all
$d = "string = '$str'!";
Win11 Pro 223H2 Gerrman
-
- Posts: 2341
- Joined: 04 Jan 2010 14:27
- Location: Pasárgada (eu vou!)
Re: "Item Count" property for CCs?
Yes, it does!
Thanks much, Peter!
Thanks much, Peter!
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...
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...
Re: "Item Count" property for CCs?
...fine!SkyFrontier wrote:Yes, it does!
Thanks much, Peter!
Win11 Pro 223H2 Gerrman
-
- Posts: 2341
- Joined: 04 Jan 2010 14:27
- Location: Pasárgada (eu vou!)
Re: "Item Count" property for CCs?
...always wanted to see extensions each folder contains, right on list, without entering each one of them.
Now I can:
(set FOLDERS as TYPE for this to work!)
It's just getting better, on and on...
Now I can:
Code: Select all
$files = trim(folderreport(files, r, <cc_item>, , , "<crlf>"), <crlf>);
$exts = formatlist(regexreplace($files, ".+\.(.*)", $1), sde, <crlf>);
$files = gettoken($files, count, <crlf>);
return "$exts, F: $files";
It's just getting better, on and on...
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...
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...