| Subject |
Re: files on desctop |
| From |
Mervyn Bick <invalid@invalid.invalid> |
| Date |
Sat, 30 Jan 2021 11:06:04 +0200 |
| Newsgroups |
dbase.getting-started |
| Attachment(s) |
find_look_in_folders.prg |
On 2021/01/30 07:01, Cornelius wrote:
> Moring there. Its me again.
>
> On the desktop properties the file section. How to I delete files that are no longer in use.
> I have delete a program form pc, but these files are still there in the look in on the navigator.
> Thanks and a nice weekend to everyone. Cornelius
>
Unless you supply a specific folder, your delete program looks in the
working folder. This is the folder specified in the "Look in" entryfield
in the Navigator.
The folders specified in the "Also look in" entryfield of the Navigator
are kept in the PATH variable in the inifile. Here multiple folders are
separated by a semi-colon.
You can extract the folders by using the SET() function. If there are
multiple folders you need to parse the sting to extract them.
breakstring() from stringex.cc in the dUFLP will do the heavy lifting
for you. Some example code is attached.
You will need to adjust your delete program so that it cleans up the
current working folder if you don't pass it a folder. If you pass it a
folder then it must use that folder.
If, for example, you have included, say, the dUFLP folder in the Also
look up list you wouldn't want to delete files from there. You can
easily add a test for specific folders in the code I've given and not
call the delete program for them.
Mervyn.
| set procedure to :duflp:stringex.cc
cPath = set('path')
if ';'$cPath
aDirs = new stringex(cPath).breakstring(';')
else
aDirs = new array()
aDirs.add(set('path'))
endif
if not empty(aDirs[1])
for n = 1 to aDirs.size
?aDirs[n]
//add code here to call delete program for this folder
next
else
msgbox('No "look-in" folders')
endif
|
|