Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: RE: Text formatting (need replaceLineBreaks)


Message #1 by iashraf@a... on Mon, 10 Sep 2001 09:10:07 -0700
hi



Can you send me the function  replaceLineBreaks



I'll be thankful to you

Advance Thanx



Imran Ashraf

Acrologix (pvt) Ltd.

Message #2 by "Peter Foti (PeterF)" <PeterF@S...> on Mon, 10 Sep 2001 16:12:12 -0400
<%

Function replaceLineBreaks(inputString)

	inputString = Replace(inputString, vbCrLf, "<br>" & vbCrLf)

	replaceLineBreaks = inputString

End Function

%>



> -----Original Message-----

> From: iashraf@a... [mailto:iashraf@a...]

> Sent: Monday, September 10, 2001 12:10 PM

> To: ASP Databases

> Subject: [asp_databases] RE: Text formatting (need replaceLineBreaks)

> 

> 

> hi

> 

> Can you send me the function  replaceLineBreaks

> 

> I'll be thankful to you

> Advance Thanx

> 

> Imran Ashraf

> Acrologix (pvt) Ltd.

> 

> 

Message #3 by Kyle Burns <kburns@c...> on Mon, 10 Sep 2001 15:25:14 -0500
Been said here before and probably will again...

Make sure to define vbCrLf as this is not an intrinsic constant.



=================================

Kyle M. Burns, MCSD

ECommerce Technology Manager

Centra Credit Union

kburns@c...



 

-----Original Message-----

From: Peter Foti (PeterF) [mailto:PeterF@S...]

Sent: Monday, September 10, 2001 3:12 PM

To: ASP Databases

Cc: 'iashraf@a...'

Subject: [asp_databases] RE: Text formatting (need replaceLineBreaks)





<%

Function replaceLineBreaks(inputString)

	inputString = Replace(inputString, vbCrLf, "<br>" & vbCrLf)

	replaceLineBreaks = inputString

End Function

%>



> -----Original Message-----

> From: iashraf@a... [mailto:iashraf@a...]

> Sent: Monday, September 10, 2001 12:10 PM

> To: ASP Databases

> Subject: [asp_databases] RE: Text formatting (need replaceLineBreaks)

> 

> 

> hi

> 

> Can you send me the function  replaceLineBreaks

> 

> I'll be thankful to you

> Advance Thanx

> 

> Imran Ashraf

> Acrologix (pvt) Ltd.

> 

> 



Message #4 by "Peter Foti (PeterF)" <PeterF@S...> on Mon, 10 Sep 2001 16:52:18 -0400
Uh... what do you mean?  I have never needed to define vbCrLf in ANY of

my ASP code and it always does just what I want it to.



-Peter



> -----Original Message-----

> From: Kyle Burns [mailto:kburns@c...]

> Sent: Monday, September 10, 2001 4:25 PM

> To: ASP Databases

> Subject: [asp_databases] RE: Text formatting (need replaceLineBreaks)

> 

> 

> Been said here before and probably will again...

> Make sure to define vbCrLf as this is not an intrinsic constant.

> 

> =================================

> Kyle M. Burns, MCSD

> ECommerce Technology Manager

> Centra Credit Union

> kburns@c...

> 

>  

>
Message #5 by Kyle Burns <kburns@c...> on Mon, 10 Sep 2001 15:51:13 -0500
Sorry,

I hadn't familiarized myself with the new language enhancements and was

still stuck back in the dark ages!  I just went out and looked at the

current language reference and, sure enough, there it was.  Thanks.



=================================

Kyle M. Burns, MCSD

ECommerce Technology Manager

Centra Credit Union

kburns@c...



 



-----Original Message-----

From: Peter Foti (PeterF) [mailto:PeterF@S...]

Sent: Monday, September 10, 2001 3:52 PM

To: ASP Databases

Subject: [asp_databases] RE: Text formatting (need replaceLineBreaks)





Uh... what do you mean?  I have never needed to define vbCrLf in ANY of

my ASP code and it always does just what I want it to.



-Peter



> -----Original Message-----

> From: Kyle Burns [mailto:kburns@c...]

> Sent: Monday, September 10, 2001 4:25 PM

> To: ASP Databases

> Subject: [asp_databases] RE: Text formatting (need replaceLineBreaks)

> 

> 

> Been said here before and probably will again...

> Make sure to define vbCrLf as this is not an intrinsic constant.

> 

> =================================

> Kyle M. Burns, MCSD

> ECommerce Technology Manager

> Centra Credit Union

> kburns@c...

> 

>  

>

 



Message #6 by David Cameron <dcameron@i...> on Tue, 11 Sep 2001 09:30:46 +1000

I prefer to use Chr(10), that way you are using the true ASCII value, not

some VB construct. Guaranteed to work.



regards

David Cameron

nOw.b2b

dcameron@i...



-----Original Message-----

From: Kyle Burns [mailto:kburns@c...]

Sent: Tuesday, 11 September 2001 6:51 AM

To: ASP Databases

Subject: [asp_databases] RE: Text formatting (need replaceLineBreaks)





Sorry,

I hadn't familiarized myself with the new language enhancements and was

still stuck back in the dark ages!  I just went out and looked at the

current language reference and, sure enough, there it was.  Thanks.



=================================

Kyle M. Burns, MCSD

ECommerce Technology Manager

Centra Credit Union

kburns@c...



 



-----Original Message-----

From: Peter Foti (PeterF) [mailto:PeterF@S...]

Sent: Monday, September 10, 2001 3:52 PM

To: ASP Databases

Subject: [asp_databases] RE: Text formatting (need replaceLineBreaks)





Uh... what do you mean?  I have never needed to define vbCrLf in ANY of

my ASP code and it always does just what I want it to.



-Peter



> -----Original Message-----

> From: Kyle Burns [mailto:kburns@c...]

> Sent: Monday, September 10, 2001 4:25 PM

> To: ASP Databases

> Subject: [asp_databases] RE: Text formatting (need replaceLineBreaks)

> 

> 

> Been said here before and probably will again...

> Make sure to define vbCrLf as this is not an intrinsic constant.

> 

> =================================

> Kyle M. Burns, MCSD

> ECommerce Technology Manager

> Centra Credit Union

> kburns@c...

> 

>  

>

 





 

Message #7 by "Tomm Matthis" <matthis@b...> on Mon, 10 Sep 2001 21:42:44 -0400
Same here..... of course, I'm putting a ref to ADO in my global.asa.....



-- Tomm



> -----Original Message-----

> From: Peter Foti (PeterF) [mailto:PeterF@S...]

> Sent: Monday, September 10, 2001 4:52 PM

> To: ASP Databases

> Subject: [asp_databases] RE: Text formatting (need replaceLineBreaks)

> 

> 

> Uh... what do you mean?  I have never needed to define vbCrLf in ANY of

> my ASP code and it always does just what I want it to.

> 

> -Peter

> 

> > -----Original Message-----

> > From: Kyle Burns [mailto:kburns@c...]

> > Sent: Monday, September 10, 2001 4:25 PM

> > To: ASP Databases

> > Subject: [asp_databases] RE: Text formatting (need replaceLineBreaks)

> > 

> > 

> > Been said here before and probably will again...

> > Make sure to define vbCrLf as this is not an intrinsic constant.

> > 

> > =================================

> > Kyle M. Burns, MCSD

> > ECommerce Technology Manager

> > Centra Credit Union

>

Message #8 by Steve Carter <Steve.Carter@t...> on Tue, 11 Sep 2001 09:42:53 +0100
Except that that is only a line feed, not a carriage-return-line-feed

sequence.



vbCrLf is a constant that contains two characters.  



> 

> I prefer to use Chr(10), that way you are using the true 

> ASCII value, not

> some VB construct. Guaranteed to work.

> 

Message #9 by David Cameron <dcameron@i...> on Wed, 12 Sep 2001 10:05:34 +1000
That was silly of me, I always get Chr(10) & Chr(13) confused.



The question is what the text that in entered contains. In my case text with

line breaks is coming from a text box. I just ran a little code to check

what the ASCII values were actually created, and Chr(13) was definitely used

for the line break. If that is what I am inserting into the database, it is

definitely the character I want to be replacing with <br> when I pull the

data out of the database.



To my mind vbcrlf would be more appropriate only if you were doing string

manipulation using vbcrlf inside VB/VBS/ASP. Please feel free to correct.



regards

David Cameron

nOw.b2b

dcameron@i...



-----Original Message-----

From: Steve Carter [mailto:Steve.Carter@t...]

Sent: Tuesday, 11 September 2001 6:43 PM

To: ASP Databases

Subject: [asp_databases] RE: Text formatting (need replaceLineBreaks)





Except that that is only a line feed, not a carriage-return-line-feed

sequence.



vbCrLf is a constant that contains two characters.  



> 

> I prefer to use Chr(10), that way you are using the true 

> ASCII value, not

> some VB construct. Guaranteed to work.

> 



 

Message #10 by "Martin Fussek" <fussek@l...> on Wed, 12 Sep 2001 14:16:05
Hello



I'm using :-)



<%

Function replaceLineBreaks(inputString)

	inputString = Replace(inputString, vbCrLf, "<br>" & vbCrLf)

	inputString = Replace(inputString, vbCr, "<br>" & vbCrLf)

	replaceLineBreaks = inputString

End Function

%>



Martin
Message #11 by Steve Carter <Steve.Carter@t...> on Thu, 13 Sep 2001 11:04:45 +0100
> The question is what the text that in entered contains. In my 

> case text with line breaks is coming from a text box. I just 

> ran a little code to check what the ASCII values were actually 

> created, and Chr(13) was definitely used for the line break. 



This is what I get with a POST operation using MS IE and MS IIS



TextArea: 

54 65 73 74 0D 0A 32 6E 64 20 6C 69 6E 65         Test..2nd line      

InputTypeText: 

54 65 73 74 68 65 6C 6C 6F                        Testhello





Note the 0D 0A sequence in the textArea.  0D = 13 = 'CR' and 

0A = 10 = 'LF' hence vbCRLF.  It may be that say NS under linux

might use a different representation of end-of-line.



I don't think you can have a multi-line value in an 

<INPUT TYPE=Text...>



Message #12 by David Cameron <dcameron@i...> on Fri, 14 Sep 2001 11:21:03 +1000
Unusual that I got something different with IE & IIS. It is probably my

mistake. I'll have another look at it, no doubt you are right. Thanks for

the work on this one. I guess I have a little code to fix. :-)



regards

David Cameron

nOw.b2b





-----Original Message-----

From: Steve Carter [mailto:Steve.Carter@t...]

Sent: Thursday, 13 September 2001 8:05 PM

To: ASP Databases

Subject: [asp_databases] RE: Text formatting (need replaceLineBreaks)





> The question is what the text that in entered contains. In my 

> case text with line breaks is coming from a text box. I just 

> ran a little code to check what the ASCII values were actually 

> created, and Chr(13) was definitely used for the line break. 



This is what I get with a POST operation using MS IE and MS IIS



TextArea: 

54 65 73 74 0D 0A 32 6E 64 20 6C 69 6E 65         Test..2nd line      

InputTypeText: 

54 65 73 74 68 65 6C 6C 6F                        Testhello





Note the 0D 0A sequence in the textArea.  0D = 13 = 'CR' and 

0A = 10 = 'LF' hence vbCRLF.  It may be that say NS under linux

might use a different representation of end-of-line.



I don't think you can have a multi-line value in an 

<INPUT TYPE=Text...>

  Return to Index