Chr(10) not working? 
Author Message
 Chr(10) not working?

Hi

I am trying to format a string of text to use in a form.

I would like to use something like

msg = "Hello" & Chr(10) & "Tony"

and have the result look something like:-

Hello
Tony

but the Chr(10) - linefeed or chr(13) carriage return do not seem to work.

I am wrong or is there a problem with this?

Tony



Mon, 01 Dec 2003 11:40:26 GMT  
 Chr(10) not working?
Try the following:

msg = "Hello" & vbCrLf & "Tony"


Quote:
> Hi

> I am trying to format a string of text to use in a form.

> I would like to use something like

> msg = "Hello" & Chr(10) & "Tony"

> and have the result look something like:-

> Hello
> Tony

> but the Chr(10) - linefeed or chr(13) carriage return do not seem to work.

> I am wrong or is there a problem with this?

> Tony



Mon, 01 Dec 2003 23:47:23 GMT  
 Chr(10) not working?
Thanks but this does not work.

The Task List reports

The name 'vbCrLf' is not declared.

Tony


Quote:
> Try the following:

> msg = "Hello" & vbCrLf & "Tony"



> > Hi

> > I am trying to format a string of text to use in a form.

> > I would like to use something like

> > msg = "Hello" & Chr(10) & "Tony"

> > and have the result look something like:-

> > Hello
> > Tony

> > but the Chr(10) - linefeed or chr(13) carriage return do not seem to
work.

> > I am wrong or is there a problem with this?

> > Tony



Mon, 01 Dec 2003 23:12:11 GMT  
 Chr(10) not working?
Import Microsoft.VisualBasic.dll


Quote:
> Thanks but this does not work.

> The Task List reports

> The name 'vbCrLf' is not declared.

> Tony



> > Try the following:

> > msg = "Hello" & vbCrLf & "Tony"



> > > Hi

> > > I am trying to format a string of text to use in a form.

> > > I would like to use something like

> > > msg = "Hello" & Chr(10) & "Tony"

> > > and have the result look something like:-

> > > Hello
> > > Tony

> > > but the Chr(10) - linefeed or chr(13) carriage return do not seem to
> work.

> > > I am wrong or is there a problem with this?

> > > Tony



Mon, 01 Dec 2003 23:00:00 GMT  
 Chr(10) not working?
Thanks

I tried Imports Microsoft.VisualBasic at the beginning of the form but

vbCrLf is still showing as not declared and chr(10) and chr(13) just show up
as squares in the text.

Tony


Quote:
> Import Microsoft.VisualBasic.dll


> > Thanks but this does not work.

> > The Task List reports

> > The name 'vbCrLf' is not declared.

> > Tony



> > > Try the following:

> > > msg = "Hello" & vbCrLf & "Tony"



> > > > Hi

> > > > I am trying to format a string of text to use in a form.

> > > > I would like to use something like

> > > > msg = "Hello" & Chr(10) & "Tony"

> > > > and have the result look something like:-

> > > > Hello
> > > > Tony

> > > > but the Chr(10) - linefeed or chr(13) carriage return do not seem to
> > work.

> > > > I am wrong or is there a problem with this?

> > > > Tony



Mon, 01 Dec 2003 21:16:21 GMT  
 Chr(10) not working?
Try ControlChars.CrLf

Corrado



Mon, 01 Dec 2003 23:26:19 GMT  
 Chr(10) not working?
It works fine for me with the vbCrLf (import the VisualBasic object for
compatibility) or with Chr(10) & Chr(13), the equivalent of VbCrLf. I will
have to test the Chr(10) by itself; however, this is not the MS norm
(although it is a UNIX norm).

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************


Quote:
> Hi

> I am trying to format a string of text to use in a form.

> I would like to use something like

> msg = "Hello" & Chr(10) & "Tony"

> and have the result look something like:-

> Hello
> Tony

> but the Chr(10) - linefeed or chr(13) carriage return do not seem to work.

> I am wrong or is there a problem with this?

> Tony



Mon, 01 Dec 2003 23:47:11 GMT  
 Chr(10) not working?
Thanks everyone

This works

Tony


Quote:
> Try ControlChars.CrLf

> Corrado



Mon, 01 Dec 2003 22:06:04 GMT  
 Chr(10) not working?


Quote:
> It works fine for me with the vbCrLf (import the VisualBasic object for
> compatibility) or with Chr(10) & Chr(13), the equivalent of VbCrLf. I will
> have to test the Chr(10) by itself; however, this is not the MS norm
> (although it is a UNIX norm).

There's always System.Environment.NewLine

--
Patrick Steele

Lead Software Architect
Image Process Design



Tue, 02 Dec 2003 00:10:18 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. Chr(10) and Chr(13) doesn't work

2. chr(10) and chr(13) in memofield gives |

3. Chr(10) & Chr(13)

4. INPUT OR READ TO STRIP CHR(10) AND CHR(13)

5. What is chr$(13) + chr$(10)

6. vbCRLF = chr(13) + chr(10)

7. Why is Chr(10) not recognized?

8. Can not pass a email from Eudora via command$, chr(10) problem

9. Chr (10)

10. Chr(10) in Text Boxes

11. Chr$(10) and TextBoxes

12. chr(10) and CR LF question in textbox

 

 
Powered by phpBB® Forum Software