CountDirectoryEntries bug

Report any Hollywood bugs here
Post Reply
User avatar
Juan Carlos
Posts: 889
Joined: Mon Sep 06, 2010 1:02 pm

CountDirectoryEntries bug

Post 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.
User avatar
Clyde
Posts: 349
Joined: Sun Feb 14, 2010 12:38 pm
Location: Dresden / Germany

Re: CountDirectoryEntries bug

Post 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).
Currently using: Hollywood 9 with Windows IDE and Hollywood 9 with Visual Studio Code and hw4vsc
User avatar
Juan Carlos
Posts: 889
Joined: Mon Sep 06, 2010 1:02 pm

Re: CountDirectoryEntries bug

Post by Juan Carlos »

You have reason in english is directories, the letter i is missing, I copyed and paste directly from documentation.
User avatar
Clyde
Posts: 349
Joined: Sun Feb 14, 2010 12:38 pm
Location: Dresden / Germany

Re: CountDirectoryEntries bug

Post by Clyde »

I guess that means that I was right?
Currently using: Hollywood 9 with Windows IDE and Hollywood 9 with Visual Studio Code and hw4vsc
User avatar
Juan Carlos
Posts: 889
Joined: Mon Sep 06, 2010 1:02 pm

Re: CountDirectoryEntries bug

Post by Juan Carlos »

Yes, I tested with #COUNTDIRECTORIES and It works fine, the bug is un the documentation.
User avatar
airsoftsoftwair
Posts: 5443
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: CountDirectoryEntries bug

Post by airsoftsoftwair »

Yes, that's an obvious spelling bug. Fixed now. Thanks for reporting!
Post Reply