Delete folder/Defaultfolder

Jeanne A. E. DeVoto jeanne at runrev.com
Thu Jan 31 02:53:22 EST 2002


At 7:55 PM -0800 1/30/2002, John Cuccio wrote:
>If I script:
>set defaultfolder to "/Hard Disk/Folder 1/folder 2"
>--Do stuff to delete files in folder 2
>delete folder "/Hard disk/folder 1/folder 2"
>
>I can not delete the folder 2 unless  I reset the defaultfolder to before
>folder 2.Even if I give the full file path to the folder I want to delete.
>
>So I have to do this. For it to work.
>
>set defaultfolder to "/Hard Disk/Folder 1/folder 2"
>--Do stuff to delete files in folder 2
>set defaultfolder to "/Hard disk/Folder 1"
>delete folder "/Hard disk/folder 1/folder 2"
>
>It seem Rev is keeping the info on the defaultfolder while in a handler and
>you can not set the defaultfolder to empty.

That's right. The defaultFolder is a global property, so it doesn't get
lost, and it is always set to a path. This is the way it's supposed to work.

One thing that may simplify life is to save the value of the defaultFolder
and restore it later:

  put the defaultFolder into savedDefaultFolder
  set the defaultFolder to "/Hard Disk/Folder 1/folder 2"
  -- do stuff
  set the defaultFolder to savedDefaultFolder -- restore original

--
Jeanne A. E. DeVoto ~ jeanne at runrev.com
http://www.runrev.com/
Runtime Revolution Limited - Power to the Developer!





More information about the use-livecode mailing list