12-21-2005 08:01 AM
12-21-2005 08:09 AM - edited 12-21-2005 08:09 AM
Message Edited by becktho on 12-21-2005 03:12 PM
12-21-2005 08:11 AM
12-21-2005 08:16 AM
Becktho, the problem with stripping once or twice is if you have more nesting (like if you originally had the VI in a llb).
I took OpenG's Get VIs Directory and modified it to get just the file name, not the directory. The rest from there was easy.
12-21-2005 08:20 AM
12-21-2005 08:36 AM
2 Problems here:
1. You need the file name, not the directory name, so this entire debate is pointless anyway, especially, when you already have an OpenG VI which does this for you.
2. You have to know your VI is inside an LLB in order to strip twice, so you have to add another condition, which will make it more complex.
12-21-2005 08:43 AM
12-21-2005 09:12 AM
Obviously, if you have several files, this is a different matter. However, since Stephan wanted the INI file to be the same name as the EXE\VI, there is only one name in this case, which means we need to get the name of that file.
While you can know the VI is an llb, the point of OpenG is utility VIs - In this case, a VI which will return the directory whether the VI is in a directory, an EXE, a LLB or any other option we can (or can't) think of. ALL I did was to change the VI to avoid the last step so we get the file path instead of the directory path. It's useful as a utility if you have a single INI file. Since an EXE file creates such a file anyway, this should apply to most users.