Subject Re: Directory verification
From Charlie <>
Date Tue, 18 Apr 2017 09:27:56 -0400
Newsgroups dbase.getting-started

Hi Heinz... Thanks so much for your help on this.  I did implement this into the code and it worked really well.  I used the drive code also.

I am closing in on finishing the deployment.   Learned a lot thinks to you.  I finally figured out that I needed to re-name the .iss file as any time I updated dbase in the project it affected that file.  Now it works great and I can see what any changes I make in the structure do without changing the .iss file.

Hopefully I'll be done by tomorrow.  Could be something I can't figure out.  If that's the case I will post it here.


Heinz Kesting Wrote:

> Hi Charlie,
> > Is it possible to verify if directories on a computer outside dbase exist?
> >
> More on this. While VALIDDRIVE() only checks if the specified DRIVE is
> valid or present, you can use the following TRY construct to test for an
> existing directory:
> private cCurDir // PRIVATE is important here
> cCurDir = set("DIRECTORY") // save current dir
> try
>     cd "D:\folder1\folder2\folder3" // example folder
>     set directory to &cDir. // switch back to previous dir
> catch (exception e)  // catch error if not existing
>     msgbox("No such folder")
> endtry
> If the command CD ... is successful, the directory is actually changed,
> but if you don't want this to happen right now, and only need to know if
> the folder exists, then you may want to switch back to the folder you
> were working in before. That's why the storage of the current folder at
> the beginning.
> If you need more functions for working with folders, you could use the
> Windows FileSystemObject. This would provide functions like
> FolderExists(), CreateExists() and DeleteFolder()
> Kind regards, Heinz