News
On June 1, we’re asking you to select a content label when starting a new topic in the Discussions area. Read more to find out why.
Choose Language Hide Translation Bar
Highlighted
djhanson
Level V

What's the forward slash ("/") escape sequence for quoted strings?

Hi All, I know the JSL backslash escape sequence for quoted strings is \!\.  But what is the equivalent escape sequence for a forward slash?  Does one even exist in JSL?  I did not see any references in the JSL scripting guide (p. 85).  thx, dj

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Craige_Hales
Staff (Retired)

Re: What's the forward slash ("/") escape sequence for quoted strings?

There is a "ignore almost everything" escape that might be useful.


Write( "\!U263Atest\!U263A\[


  anything " goes ' \ here \!n \!U263A


  except square-bracket back-slash


]\\!U263Atest\!U263A" );




☺test☺

  anything " goes ' \ here \!n \!U263A

  except square-bracket back-slash

☺test☺

Note the smile face characters from the Unicode escape \!U263A work outside of the \[ ... ]\ part of the string but not inside.  The two adjacent back slashes in the last line are doing two different jobs; one belongs with the square bracket and one with the Unicode escape.  And, of course, if you leave out the ]\, the rest of your JSL will be part of the un-terminated string, causing an error.  Keep the string on one line and the editor's syntax coloring will work better too.

Craige

View solution in original post

1 REPLY 1
Highlighted
Craige_Hales
Staff (Retired)

Re: What's the forward slash ("/") escape sequence for quoted strings?

There is a "ignore almost everything" escape that might be useful.


Write( "\!U263Atest\!U263A\[


  anything " goes ' \ here \!n \!U263A


  except square-bracket back-slash


]\\!U263Atest\!U263A" );




☺test☺

  anything " goes ' \ here \!n \!U263A

  except square-bracket back-slash

☺test☺

Note the smile face characters from the Unicode escape \!U263A work outside of the \[ ... ]\ part of the string but not inside.  The two adjacent back slashes in the last line are doing two different jobs; one belongs with the square bracket and one with the Unicode escape.  And, of course, if you leave out the ]\, the rest of your JSL will be part of the un-terminated string, causing an error.  Keep the string on one line and the editor's syntax coloring will work better too.

Craige

View solution in original post