quote:
Originally posted by skorpan
quote:
Originally posted by alexp2_ad
You actually WANT a double \\ for some reason?
...
code:
Messenger.ReceiveFileDir
Returns something like: c:\my documents\my recieved files, right?
This is stored in a string.
Before I can use it with code:
Shell.Run
I need to change it into: c:\\my documents\\my recieved files.
How do I do that?
You don't!!
The Messenger.ReceiveFileDir (just as other similar functions) returns a proper string already. Do NOT change the slashes to double slashes! This will result in unwanting effects and possible errors.
You need specifiy a double slash ONLY when you type the variable yourself like:
MyString = "here I manually enter some text with some \\ slashes in \\ it and some new lines: \n\n\n hello"
If you print out that variable you'll see:
"here I manually enter some text with some \ slashes in \ it and ...."
As explained before the slash is a special character and means "take the next character literally"
(if the next character isn't a control character). So if you enter a string value
manually you need to specify a double slash so the programming language knows it must take the second slash literally.
However, when functions return variables, all the charaters inside the variable are already correct; the programming language has already taken the slashes literally:
MyString = Messenger.ReceiveFileDir
If you print out that string you will see again only single slashes as it should be and just the same as with the output of our previous string.
If the returned string wasn't proper formatted you would not see something like "C:\Hello", but you would see "C:Hello".
so... DO NOT CHANGE SLASHES TO DOUBLE SLASHES in strings returned by functions.