Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Delete complete directory

Author
Message
sberk
14
Years of Service
User Offline
Joined: 6th Jun 2010
Location: next to a cup of coffee
Posted: 15th Jul 2011 12:16 Edited at: 15th Jul 2011 12:18
Hi,
I would like to delete a directory including all files and subdirectory. Since I can only delete empty directorys I just want to parse all possible subdirectorys to generate a list of files. I wanted to use a recursive function to achieve this.


My problem is, that every call of perform checklist for files overwrite the results of the former call. My first attemp to store it in a local array did not help, since I don't know how to declare local arrays (is it possible in darkbasic?). Is there any way to store the result of perform checklist localy?
sberK

Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 15th Jul 2011 12:43
Quote: "My first attemp to store it in a local array did not help, since I don't know how to declare local arrays (is it possible in darkbasic?)."

Apparently, have a look at this:


Arrays are automatically global by default. So have another try with local arrays using the local command.

sberk
14
Years of Service
User Offline
Joined: 6th Jun 2010
Location: next to a cup of coffee
Posted: 15th Jul 2011 13:04 Edited at: 15th Jul 2011 13:05
Hi, thanks a lot. The now working delete all function is:


But be carefull, I accidently deleted my whole test-project for developing this function . If anybody can use this few lines, feel free.

Login to post a reply

Server time is: 2024-11-22 19:14:07
Your offset time is: 2024-11-22 19:14:07