Inserting a carriage return in a text box 
Author Message
 Inserting a carriage return in a text box

Quote:
>OutputText.Text = "N100" & Space(1) & "O" & programnumber & Chr(13) &
"N200"
>& Space(1) & "G90" & Chr(13) & "N300" & Space(1) & "G" & fixtureoffset &
and
>so on...
>Insted of a carriage return it displayes a "|" I tried using the ALT + 013
>during run time and it inserted a carriage return like it is suppose to. I
>tried different fonts and I kept getting the same results. i searched
through
>Microshafts crappy help and came up with nothing. Sure aint like QBasic.

Try to use vbCrLf instead (chr(10) + chr(13))

That should work...

(windows's linefeed is 10+13 and not only 13 and when you manualy insert 13
windows adds 10 infront of it, that's the reason your code don't work, but
it works when you do it manualy)

Tor-Erik



Mon, 09 Jul 2001 03:00:00 GMT  
 Inserting a carriage return in a text box
: >OutputText.Text = "N100" & Space(1) & "O" & programnumber & Chr(13) &
: "N200"
: >& Space(1) & "G90" & Chr(13) & "N300" & Space(1) & "G" & fixtureoffset &
: and
: >so on...

: >Insted of a carriage return it displayes a "|" I tried using the ALT + 013
: >during run time and it inserted a carriage return like it is suppose to. I
: >tried different fonts and I kept getting the same results. i searched
: through
: >Microshafts crappy help and came up with nothing. Sure aint like QBasic.

: Try to use vbCrLf instead (chr(10) + chr(13))

: That should work...

: (windows's linefeed is 10+13 and not only 13 and when you manualy insert 13
: windows adds 10 infront of it, that's the reason your code don't work, but
: it works when you do it manualy)

: Tor-Erik

You might check the order of things.  I believe vbCrLf is the correct
constant to use, but it's Chr$(13) + Chr$(10), not the other way around.

So if you are coding Chr$(13) a the end of each line, just adding a
Chr$(10) should do it.

BTW, if you are outputting to a file, the Print statement will add the CR
+ LF for you.

HTH -
--



Mon, 09 Jul 2001 03:00:00 GMT  
 Inserting a carriage return in a text box

Quote:
> : Try to use vbCrLf instead (chr(10) + chr(13))

> : That should work...

> : (windows's linefeed is 10+13 and not only 13 and when you manualy insert 13
> : windows adds 10 infront of it, that's the reason your code don't work, but
> : it works when you do it manualy)
> You might check the order of things.  I believe vbCrLf is the correct
> constant to use, but it's Chr$(13) + Chr$(10), not the other way around.

> So if you are coding Chr$(13) a the end of each line, just adding a
> Chr$(10) should do it.

When I first tried inserting CR/LF's I initially tried just adding
+chr$(13)+chr$(10) or +chr$(10)+chr$(13) to the end of the string I was
sending to the text box, but this never worked, either way. What I
eventually did was create a string called nl$=chr$(13)+chr$(10) , and
put +nl$ at the end of the string being sent to the text box. On the
surface, this seems to be exactly the same, but it works. Perhaps the
previous comment about VB adding bytes when it sees the individual
characters being sent is the reason, but I never bothered trying to
figure out why, I just use nl$.

+----------------------------------+
| Bill Jones, N3JLQ,Sweden, Maine  |

| http://www.megalink.net/~wejones |
+----------------------------------+



Mon, 09 Jul 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Inserting carriage return in TEXT string

2. Carriage Returns In Text Boxes

3. Carriage Return in text box

4. carriage return in a text box?

5. Carriage return in text box?

6. How to hide linefeed, and carriage return characters in text boxes

7. Putting a Carriage Return in to a rich text box

8. Carriage return & Text boxes in VB 4.0

9. Carriage Returns in a Text Box

10. finding carriage returns in text boxes

11. Carriage return in a text box? vb5

12. HELP! Counting carriage returns in multiline text box

 

 
Powered by phpBB® Forum Software