LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

string to path

hello,

if string is like this
"c:\abc /user:deniss" result is "c:\abc /user:deniss" . All is Ok.
but if like this
"\\rain\ password /user:deniss" result is \\rain\ password /user\deniss"

colon is changed to "\"

Its no good.

And question this is a bug or feature? 🙂

LV 6.02
W2K pro SP3.

ps. of course i can first map disk with "net use..."
and then connect to disk with "no problema" 🙂

Deniss Karai
0 Kudos
Message 1 of 3
(2,780 Views)
Hi Deniss
You are right, that is messy. I imagine it has something to do with the special "\" character. Normally, e.g. in C, you use this character to select a special sign. So the structure like "\\" will mean to the system that the second "\" is a special character not a text.
I have played a littel with this and see some more:

\ \rain\ password /user:deniss
is tranferred to:
D:\ \rain\ password /user:deniss

\\\\\\\\\\\\rain\ password /user:deniss
to
\\rain\ password /user\deniss

"\\rain\ password /user:deniss"
to
"\rain\ password /user:deniss"

\\rain\ password\fgdfg /user:deniss
to
\\rain\ password\fgdfg /user:deniss

It looks like the character "\" means a lot.

But I have found a soluition for you. Just put the incomming strin
g into a array and then use "Array of Strings to Path" instead of String to Path. That will give you the proper value. I enclose the file.

regards
Pawel
Message 2 of 3
(2,780 Views)
An interesting problem with a good solution.

On reading the help for the String to Path function it said, "Converts a string, describing a path in the standard format for the current platform, to a path." I think the fact it says 'in the standard format for the current platform' means it tries to be a bit clever and converts strings which are not written completely right into a path, making certain assumptions which aren't always the case.

The array function is a good way to get around it.

Good work..

Kim
0 Kudos
Message 3 of 3
(2,780 Views)