07-27-2005 03:01 AM
07-27-2005 03:16 AM
07-27-2005 03:18 AM
Hi,
you could use the LIST Directory vi (File I/O => Advanced). It would return the list of directories (or files) at a certain path.
Search the array of directories for the directory name you want to check.
Dai
07-27-2005 03:44 AM
07-27-2005 01:17 PM
Many thanks to all of you.
I hoped to get a solution that don't prompt the user with an error message.
07-27-2005 01:46 PM
07-27-2005 06:20 PM
Hello,
Attached is an example; specify a directory in the only front panel control and if it exists, it will tell you, and if the directory doesn't exist but you specify a path which exists up to the last directory specified, it will create that directory. If you specify a path which doesn't exist (where the only non-existent part is NOT simply the final directory specified in the path), then it will tell you that the path couldn't be found.
07-27-2005 08:06 PM
The best thing you can do is go into your LV options and turn off automatic error handling. It is very bad because the only options you have are to ignore the error, or stop your program immediately with no deinitialization, just stop. Very bad. The folks in Austin should be thinking up ways to help people to write good code, not simplifying the process of writing bad.
Mike...
07-28-2005 06:06 AM
Mike, I'm not sure that's the best thing to do.
A while back someone posted a question about "why doesn't this work?". His application was very big, even after he cut it down, so even starting to help him was hard, because we couldn't understand what the proper operation of the program was. The only clue we had to go on was automatic errors, which he didn't see, because he turned off the auto handling (he thought there was no need to take care of property node errors). So he didn't see the errors, and I had trouble understanding them because I didn't know what the app was supposed to do.
The moral of that (other than the obvious one) was to leave the auto handling on. Since it only kicks in if you didn't wire the error cluster out, it will not change the behaviour if you are handling errors and it will allow you to know you have errors in case you forgot. Obviously, you can say that leaving it on will cause people to "forget" error handling, but that's already a psychological discussion.
07-28-2005 07:20 AM