05-17-2007 01:09 PM - edited 05-17-2007 01:09 PM
Message Edited by eaolson on 05-17-2007 01:10 PM
05-17-2007 01:39 PM
05-17-2007 01:47 PM
This problem pertains to the String to Path vi as well. According to the description in the LabVIEW help, it should do the following:
path is the platform-independent representation of the path described by string. If string is not a valid path descriptor on the current platform, the function sets path to <Not a Path>. path is of the same data type structure as string.
However, any string such as "!@#$// (including the quotation mark!) will be returned DUPLICATED but cast as a path rather than returning <Not a Path> as described. This will appear to be a valid path when tested by the "Not A Number/Path/Refnum?" object as noted in the original post in this thread.
05-21-2007 09:21 AM
But even an empty string is a valid path, once converted. On the PC, it's a virtual directory containing all the drive letters.
@tbob wrote:In my opinion, the output of Path To String should be an empty string when the input is Not A Path. Maybe NI can explain why this action was chosen.
05-21-2007 09:50 AM - edited 05-21-2007 09:50 AM
Message Edité par JB le 05-21-2007 04:55 PM
Message Edité par JB le 05-21-2007 04:56 PM
05-21-2007 10:50 AM
05-21-2007 01:58 PM
Done.
@Caseyw wrote:In addition, I would encourage you to submit a product suggestion at ni.com/contact. Your suggestion will go directly to the responsible developer, and we take every one of your suggestions very seriously.
I was trying to do some string maniuplation on a path name (i.e. change c:\foo.txt to c:\foo_01.txt). My first attempt was to convert the entire path to a string, and work on the full string, where this issue came up. It was easy to get around it with a combination of Strip Path and Build Path. If the path input to Build Path is NAP, it returns NAP, regardless of the string input.
What exactly are you trying to accomplish in your application by converting a path to string and then back again? I would be glad to work with you further to find an alternate method. I am sure that we can work together to get your program up and running.
05-22-2007 10:24 AM