Read a MultiLine textbox line by line? 
Author Message
 Read a MultiLine textbox line by line?

I am trying to figure out a way to read a textbox.Text line by line. I want
to process each line just as though this line was a line in a text file or a
single row of data. I want to be able to search inside each line and, based
on the results of that search for specific keywords/etc, I want to process
that line.
I have searched and searched and cannot find anything that gives an example
or shows me how to do it...

Anyone have any ideas?



Wed, 11 Aug 2004 01:42:54 GMT  
 Read a MultiLine textbox line by line?
Because the text in the box does not necessarily have line-break characters
(ie, carriage return/linefeed combinations) at the end of each line, you
won't be able to determine where each line ends.

The problem would probably be eliminated if you used a listbox instead;
then you can grab each list item and parse it.

Alternatively, if you can force users to hit ctrl-enter to end a line, you
can determine where the line breaks by looking for ascii 13, (chr(13)),
which is the carriage return.

Hope this helps.

Steven Bras, MCSD
Microsoft Developer Support/Visual Basic WebData

This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure? For information about the Microsoft Strategic Technology
Protection Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.



Wed, 11 Aug 2004 01:59:15 GMT  
 Read a MultiLine textbox line by line?
yeah I was afraid of that. Thanks for the help!



Quote:
> Because the text in the box does not necessarily have line-break
characters
> (ie, carriage return/linefeed combinations) at the end of each line, you
> won't be able to determine where each line ends.

> The problem would probably be eliminated if you used a listbox instead;
> then you can grab each list item and parse it.

> Alternatively, if you can force users to hit ctrl-enter to end a line, you
> can determine where the line breaks by looking for ascii 13, (chr(13)),
> which is the carriage return.

> Hope this helps.

> Steven Bras, MCSD
> Microsoft Developer Support/Visual Basic WebData

> This posting is provided "AS IS" with no warranties, and confers no
rights.

> Are you secure? For information about the Microsoft Strategic Technology
> Protection Program and to order your FREE Security Tool Kit, please visit
> http://www.microsoft.com/security.



Wed, 11 Aug 2004 02:32:39 GMT  
 Read a MultiLine textbox line by line?
Why wouldn't the Lines property of a TextBox be applicable here, assuming we _aren't_ talking about a TextBox with WordWrap on???

--
Michael Harris
Microsoft.MVP.Scripting
--


Quote:
> Because the text in the box does not necessarily have line-break characters
> (ie, carriage return/linefeed combinations) at the end of each line, you
> won't be able to determine where each line ends.

> The problem would probably be eliminated if you used a listbox instead;
> then you can grab each list item and parse it.

> Alternatively, if you can force users to hit ctrl-enter to end a line, you
> can determine where the line breaks by looking for ascii 13, (chr(13)),
> which is the carriage return.

> Hope this helps.

> Steven Bras, MCSD
> Microsoft Developer Support/Visual Basic WebData

> This posting is provided "AS IS" with no warranties, and confers no rights.

> Are you secure? For information about the Microsoft Strategic Technology
> Protection Program and to order your FREE Security Tool Kit, please visit
> http://www.microsoft.com/security.



Wed, 11 Aug 2004 06:02:59 GMT  
 Read a MultiLine textbox line by line?
That's a good point; however, the Lines property only returns individual
lines if they are delimited with a carriage return. Thus the user will
still have to use the ctrl-enter combination to delineate the input.

Steven Bras, MCSD
Microsoft Developer Support/Visual Basic WebData

This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure? For information about the Microsoft Strategic Technology
Protection Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.



Sat, 14 Aug 2004 01:41:22 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Limitting line length of each line within multiline textbox

2. Reading a single line in a multiline textbox

3. Multiline Textbox Cause Page Overflows when Printing or doesn't print all lines

4. finding line number cursor is in multiline textbox

5. forcing multiline textbox to scroll to last line...

6. Finding Line number in MultiLine TextBox (VB4)

7. HELP:limiting # of lines in a Multiline Textbox

8. Line limit in Multiline Textbox

9. Retrieving text lines in multiline textbox

10. Multiline Textboxes - Limiting Characters Per Line

11. Setting tabs and line-end in a multiline Textbox

12. Help multiline textbox no chr(13) at the end off a line

 

 
Powered by phpBB® Forum Software