Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Runtime Error : Unterminated string constant 1

Status
Not open for further replies.

Karl Blessing

Programmer
Feb 25, 2000
2,936
US
this is the section of the HTML that is sent to the client, and I get the Error on each Go(... line about Unterminated string constant, but as you can see, both the single quote, and double quotes are terminated, and I havent changed them from before, but now I get the error all the sudden.<br><FONT FACE=monospace><br>&lt;Table border=1 style=&quot;width:100%;&quot;&gt;<br>&nbsp;&lt;TH bgcolor=Black&gt;&lt;Font color=White&gt; Root &lt;/FONT&gt;&lt;/TH&gt;<br>&nbsp;&lt;TR&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;TD onclick=&quot;Go('A:\')&quot;&gt; A&lt;BR&gt; &lt;/TD&gt;<br>&nbsp;&lt;/TR&gt;<br>&nbsp;&lt;TR&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;TD onclick=&quot;Go('C:\')&quot;&gt; C&lt;BR&gt; &lt;/TD&gt;<br>&nbsp;&lt;/TR&gt;<br>&nbsp;&lt;TR&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;TD onclick=&quot;Go('D:\')&quot;&gt; D&lt;BR&gt; &lt;/TD&gt;<br>&nbsp;&lt;/TR&gt;<br>&nbsp;&lt;TR&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;TD onclick=&quot;Go('E:\')&quot;&gt; E&lt;BR&gt; &lt;/TD&gt;<br>&nbsp;&lt;/TR&gt;<br>&lt;/Table&gt; <br></font><br>this is the ASP code being used to make those<br><FONT FACE=monospace><br>Dim d, dc, s, n<br><br>Set dc = fs.Drives<br>%&gt; &lt;Table border=1 style=&quot;width:100%;&quot;&gt; &lt;%<br>&nbsp;&nbsp;%&gt;&lt;TH bgcolor=Black&gt;&lt;Font color=White&gt; Root &lt;/FONT&gt;&lt;/TH&gt;&lt;%<br>&nbsp;&nbsp;For Each d in dc<br>&nbsp;&nbsp;%&gt; &lt;TR&gt; &lt;%<br>&nbsp;&nbsp;&nbsp;&nbsp;s = d.DriveLetter<br>&nbsp;&nbsp;&nbsp;&nbsp;If d.DriveType = 3 Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;n = d.ShareName<br>&nbsp;&nbsp;&nbsp;&nbsp;ElseIf d.IsReady Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;n = d.VolumeName<br>&nbsp;&nbsp;&nbsp;&nbsp;End If<br>&nbsp;&nbsp;&nbsp;&nbsp;s = s & n & &quot;&lt;BR&gt;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;%&gt; &lt;TD onclick=&quot;Go('&lt;%=d.DriveLetter & &quot;:\&quot;%&gt;')&quot;&gt; &lt;%=s% &gt; &lt;/TD&gt;&lt;%<br>&nbsp;&nbsp;&nbsp;&nbsp;%&gt; &lt;/TR&gt; &lt;%<br>&nbsp;&nbsp;&nbsp;Next<br>%&gt; &lt;/Table&gt; &lt;%<br>end if<br></font> <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
Dear Karl,<br><br>backslash is an escape character in Javascript, you need this:<br><br>&lt;TD onclick=&quot;Go('A:\\')&quot;&gt; <br><br>Hope this helps<br>-pete<br>
 
for some reason it likes it , if it's no \, or if its \\, but it hates \ making my script unable to work, I havent changed it but now it's having fits <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
I figured it out, originally the only script (the GO script,everything else is serverside) was a VbScript, but I wanted to make it more compatible, so I changed it to a JavaScript, as a result, I forgot that JavaScript was very close to C++, in the same sense it might take the same type of string, so I had to use the replace command to make sure that every single \ was a \\ instead. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
Karl,<br>&nbsp;&nbsp;&nbsp;&nbsp;You have to get the prize for the person who answers his own posts most frequently!&nbsp;&nbsp;;-)<br> <p>nick bulka<br><a href=mailto: > </a><br><a href= > </a><br>
 
hehe funny nick Usally what I do , if I feel I'll need help, I post my own progress, funny thing is, someone one day may come accross this post and find it helpful to their own problems. like Sharing experience(no matter how &quot;duh&quot; it may seem) but there has been post where I keep a follow up of what I try to do to fix it, but still no answer. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
So are you ignoring my posts? since my previous post stated:<br><br>backslash is an escape character in Javascript, you need this:<br><br>&lt;TD onclick=&quot;Go('A:\\')&quot;&gt; <br><br>This doesn't qualify as an answer? I guess I might as well save my time that I spend on these boards and use it for another purpose.
 
palbano, if you notice the post has a Star, that's your star. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
Dear Karl,<br><br>I don't know about the 'stars' what are they for and what do they mean?<br><br>Thanks<br>-pete
 
When someone finds a post helpful, they vote them as tipmaster, as a result, it shows a star on the post that someone has been voted for, havent you seen that thing when starting up (so and so was voted tip master of the week...) in otherwords I have given you credit, and I havent seen you post until I finally put that last post about the javascript, dont know why I didnt catch it before, but you still gotten credit for it. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
Thanks Karl,<br><br>&gt;havent you seen that thing when starting up (so and so was voted tip master of the week...) <br><br>Yes I've seen that, but I couldn't put the connection to the star together &lt;doh!&gt; Thanks for clearing it up.<br><br>-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top