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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unterminated String Constant 1

Status
Not open for further replies.

karthik555

IS-IT--Management
Oct 15, 2002
36
IN
Hello!

I have a server side array (VBScript). I pass data from this Server side array to a client side array
Code:
<SCRIPT LANGUAGE=vbscript>		
<%
For intRow = 1 to Ubound(arrMlt,1)
	For intCol = 1 to UBound(arrMlt,2)
%>
  arrCMlt(<%=intRow%>, <%=intCol%>) = "<%=arrMlt(intRow, intCol)%>"
<%
	Next 'intCol
Next 'intRow
%>
</VBSCRIPT>

If the string in the Server side array is long (say beyond 50 chars long) then I get this error

---------------------------
Error
---------------------------
A Runtime Error has occurred.
Do you wish to Debug?

Line: 1590
Error: Unterminated string constant
---------------------------
Yes No
---------------------------


When I View Source of the ASP Page, in the line reported I see this

arrCMlt(26, 6) = "FLIGHT AUGMENTATION (FAC)
OPERATIONAL CHECK OF AU"

The string written has wrapped into next line (may be because it is too long) which results in the above error.

How do I prevent the text from wrapping?

Thanks in advance

Karthik
 
My guess would be that the original data in your array has a carriage return in it. Try replacing vbCrLf with something noticeable (like "##########") in your code and run it again.
It's up to you what you want to replace it with for future use, depending on your client-side language you might wantto replace it with "<br>" or something like that, or you might just want to strip it out by replaceing it with "".
There is no auto wrapping in strings, if there is a carriage return it's because either your code put it there (which I don't see it doing) or because it was already there in the data beforehand.

barcode_1.gif
 
Tarwn!

You were spot on! There was some junk character in the data (in DBMS). I found out it is ascii(10). (God knows what!).

Once I use Replaced it with "", now it works fine.

Thanks a ton!

Regards

Karthik
 
CHR(10) is a LineFeed character. Check out :
for your 'mystery characters'

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top