Page 1 of 1
SC listfolder does not return '0' for Count
Posted: 02 Sep 2015 21:41
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.
Re: SC listfolder does not return '0' for Count
Posted: 02 Sep 2015 22:42
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
Re: SC listfolder does not return '0' for Count
Posted: 03 Sep 2015 01:00
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...
Re: SC listfolder does not return '0' for Count
Posted: 03 Sep 2015 08:02
by admin
Yep, bug. Fix comes.
Re: SC listfolder does not return '0' for Count
Posted: 03 Sep 2015 13:09
by klownboy
Thanks Don, though the fix may require looking at some old scripts that worked around that bug. No big deal.