SC listfolder does not return '0' for Count

Things you’d like to miss in the future...
Forum rules
You might want to read this if you're looking for priority service

:info: Please Include The Following Information
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: Use Your Profile Or Signature
We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
Post Reply
Papoulka
Posts: 455
Joined: 13 Jul 2013 23:41

SC listfolder does not return '0' for Count

Post by Papoulka »

If the current folder has one subfolder, then

Code: Select all

echo listfolder(<curpath>, "*", 2+32);
will report the digit '1'. But if there are no subfolders it reports a blank, rather than the digit '0'. I think it should be '0' since a numerical count is being specifically requested by the '32' flag bit. If that flag was not set then I would expect the "" / blank.

klownboy
Posts: 4481
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

Re: SC listfolder does not return '0' for Count

Post by klownboy »

That is odd in that with flag '32' you'd expect a count of '0'. We've noted that once before here...http://www.xyplorer.com/xyfc/viewtopic. ... er#p110272

Papoulka
Posts: 455
Joined: 13 Jul 2013 23:41

Re: SC listfolder does not return '0' for Count

Post by Papoulka »

Thank you, klownboy. I was a little surprised that I didn't find previous mention of this; missed that thread somehow. This anomaly causes trouble when using a counter because a comparison with numeric 0 fails if the string is actually "". Once you figure out the problem it can be coded around, of course...

admin
Site Admin
Posts: 67271
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: SC listfolder does not return '0' for Count

Post by admin »

Yep, bug. Fix comes.

klownboy
Posts: 4481
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

Re: SC listfolder does not return '0' for Count

Post by klownboy »

Thanks Don, though the fix may require looking at some old scripts that worked around that bug. No big deal.

Post Reply