Page 1 of 1

CountDirectoryEntries bug

Posted: Mon May 25, 2020 8:52 pm
by Juan Carlos
I find a possible bug with this instruction CountDirectoryEntries

Code: Select all

  DestyCarpeta$=PathRequest("Drawer?") 
 
  OpenDirectory(1, DestyCarpeta$) 
  ;n=CountDirectoryEntries(id[, what] 
  NumFiles=CountDirectoryEntries(1, #COUNTFILES) 
  NumCarpetas=CountDirectoryEntries(1, #COUNTDIRECTORES) 
  NumTotal=CountDirectoryEntries(1, #COUNTBOTH) 
  SetFont(#SANS, 20) 
  SetFontColor(#WHITE) 
  SetFontStyle(#ANTIALIAS) 
  TextOut(#CENTER, #CENTER, "Files: "..NumFiles) 
  TextOut(#CENTER, #CENTER+25, "Drawers: "..NumCarpetas) 
  TextOut(#CENTER, #CENTER+45, "Total files and drawes: "..NumTotal) 
This line NumCarpetas=CountDirectoryEntries(1, #COUNTDIRECTORES) gives this mistake: Constant not found!

Other problem under Windows report extra number of files and drawers, from hidden system files.

Re: CountDirectoryEntries bug

Posted: Tue May 26, 2020 9:57 am
by Clyde
I can't test it right now, but I think there is a spelling error in the documentation and therefor in your code. I think the name of the constant has to be #COUNTDIRECTORIES (with an I between R and I).

Re: CountDirectoryEntries bug

Posted: Wed May 27, 2020 10:17 am
by Juan Carlos
You have reason in english is directories, the letter i is missing, I copyed and paste directly from documentation.

Re: CountDirectoryEntries bug

Posted: Wed May 27, 2020 5:39 pm
by Clyde
I guess that means that I was right?

Re: CountDirectoryEntries bug

Posted: Thu May 28, 2020 1:46 pm
by Juan Carlos
Yes, I tested with #COUNTDIRECTORIES and It works fine, the bug is un the documentation.

Re: CountDirectoryEntries bug

Posted: Sat May 30, 2020 10:49 pm
by airsoftsoftwair
Yes, that's an obvious spelling bug. Fixed now. Thanks for reporting!