JaedenRuiner
Well-known member
- Joined
- Aug 13, 2007
- Messages
- 340
- Programming Experience
- 10+
I do quite a bit of formatting in some of my parsing controls, and mostly it is harmless, since the format strings are constants. the line:
is no different (intrinsically) from
However, the latter of the two is more appealing to the eyes, so while debugging as well as while reformatting the "typed" commands into the editor, it looks more professional and clean. (I also output the formmatted commands to a debug file, but that is of no concern)
So anyway, there I am, I grab from a RichTextBox the command that was typed, (split on the ; character) and I execute in sequence each command, reformatting them and replacing the old with the new as it executes.
But here is the thing:
Now, I could use Environment.NewLine as well, but it too equals #13#10 as the standard MSDOS CR/LF line terminator format. Now enter's the brain dead RichTextBox and it strips the #13 character from the strings, so when I try this:
It doesn't work (-1 causing exception).
How can I tell the RichTextBox to not strip the carriage return for each new line? I've tried wordwrap = false, but it still keeps only the 10 not the 13.
Thanks
VB.NET:
select * from MyTable;
VB.NET:
select *
from mytable
So anyway, there I am, I grab from a RichTextBox the command that was typed, (split on the ; character) and I execute in sequence each command, reformatting them and replacing the old with the new as it executes.
But here is the thing:
VB.NET:
Const SQLSELECT = "SELECT {0}" & vbCrLf & "FROM {1}" & vbCrLf
Now, I could use Environment.NewLine as well, but it too equals #13#10 as the standard MSDOS CR/LF line terminator format. Now enter's the brain dead RichTextBox and it strips the #13 character from the strings, so when I try this:
VB.NET:
RichText.SelectionStart = RichText.Text.IndexOf(MySqlString)
How can I tell the RichTextBox to not strip the carriage return for each new line? I've tried wordwrap = false, but it still keeps only the 10 not the 13.
Thanks