Backslash disapears 
Author Message
 Backslash disapears

Hi!
I have a problem. I enter a path to a document on another machine (document
server). This is saved to a database. When I try to use it \ is gone. I
guess \ is used to something else since I get different character depending
what comes after \. So how should I do so my \ stays?? \\ or someother
combination??

(Using asp, jscript, MTS and SQL Server)

Thx for all help.
/Bg



Tue, 13 May 2003 03:00:00 GMT  
 Backslash disapears

Quote:
> So how should I do so my \ stays?? \\ or someother combination??

Backslash is an escape character in Jscript, if you want to use one in a
string it must itself be escaped - use two...

HTH
Richard Cunningham



Tue, 13 May 2003 03:00:00 GMT  
 Backslash disapears
Your guess is right: "\" is a special character in J(ava)Script.
It either adds or removed special meaning to the following character:
- a \n means "newline"
- a \" means a literal quote, instead of end-of-string

to use a literal \ you need to add an other \, to "escape" it's special
meaning.

Note: this behavior applies only to strings that you define
in your code. Once the string contains a literal \ it won't suddenly
start using it as a special character again.

Hans Kesting


Quote:
> Hi!
> I have a problem. I enter a path to a document on another machine
(document
> server). This is saved to a database. When I try to use it \ is gone. I
> guess \ is used to something else since I get different character
depending
> what comes after \. So how should I do so my \ stays?? \\ or someother
> combination??

> (Using asp, jscript, MTS and SQL Server)

> Thx for all help.
> /Bg



Tue, 13 May 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. disapearing content?

2. message box disapearing before i click it

3. how to make a div disapear?

4. Stop backslash behaving as the escape character

5. getting to read the backslash

6. Backslash problems - help!

7. How to print backslash?

8. Reading registry values containing a backslash (\)

9. double backslashes

10. Slash/Backslash, Absolute/Relative Path in FSO

11. using Registry functions on valuenames with backslashes?

12. Using Backslash with RegWrite

 

 
Powered by phpBB® Forum Software