Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 15th, 2011, 03:29 PM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 112
Thanks: 12
Thanked 0 Times in 0 Posts
Default spaces in my variable...

hi to all...

can someone please help me with this one, i'm getting 1 spaces after each variable...
i tried trim and replace and still nothing...

intcont = rs("NoGenerator") & chr(13)
intpall = rs("PalletID") & chr(13)


For i = 1 To intqty
Response.Write "{B,1,N,1|E,0,0,1,1,0,1|<br>"& Chr(13)
Response.Write "1," & Chr(34) & intpall & intcont & Chr(34) & "|<br>"& Chr(13)
Response.Write "2," & Chr(34) & intpall & intcont & Chr(34) & "|}<br>"& Chr(13)

intcont = intcont + 1
Next


output
{B,1,N,1|E,0,0,1,1,0,1|
1,"P 3472 "|
2,"P 3472 "|}



Can someone telling me what i doing wrong...

thanking you in advance.

Rino.
 
Old March 15th, 2011, 03:36 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I don't see any JavaScript in that code. Are you sure you posted the correct code (or posted in the correct forum)?

That said, chr(13) is a line break which causes trim to not remove any trailing spaces anymore. Try trimming before you concatenate.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
RinoDM (March 15th, 2011)
 
Old March 15th, 2011, 03:50 PM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 112
Thanks: 12
Thanked 0 Times in 0 Posts
Default

i wasn`t too sure where to post. Sorry about that.

But your post help me think and made me re-add my replace function too...
but instead of doing

replace(intpall," ","")

i change it too

replace(intpall,Chr(13),"")

and it worked...

thank you
Rino





Similar Threads
Thread Thread Starter Forum Replies Last Post
Spaces XP Programmer911 General .NET 1 December 19th, 2007 07:03 AM
Diference between these two name spaces pradeepn XSLT 1 June 25th, 2007 02:31 AM
disappearing spaces gezi XSLT 0 March 26th, 2006 02:23 AM
Frame Spaces EvilGuyWhoEatsBrains HTML Code Clinic 2 January 5th, 2005 12:24 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.