Quote:
Originally Posted by jmcilhinney
I'm not sure why the RTB does that or if there's a way to stop it, but have you considered NOT using CrLf as a line break and just using Lf? Modern Windows handles that gracefully in all cases I've seen.
|
Not in notepad, which is where I most often edit my SQL for this. I resolved it in a better manner. My SqlParsing engine has a property .SQL which parses when Set, but Builds on Get. My Code was, shall we say, having some delays whenever I would select a different "results tab", it would try to do:
Code:
SqlText.SelectionStart = SqlText.Text.IndexOf (Parser(i).SQL)
SqlText.ScrollToCaret
Well, that would s..l...o...w.. down the refresh because it was recalculating. I've done other searches around the web since I posted this, and it is a recurrent problem with the RTB, which comes to question how to export a MSDOS Cr/Lf Text file from the control, but i resolved the issue by simply utilizing the .Tag element of the individual TabPages. When each command is finished execution an event triggers to set the "status" icon of each tab. When I set the status to success I execute:
Code:
TabPage.Tag = Parser(index).SQL.Replace(vbCr, "")
which then later on TabPage selection:
Code:
SqlText.SelectionStart = SqlText.Text.IndexOf(TabCtrl.SelectedTab.Tag)
SqlText.ScrollToCaret
So, in the end, it is still frustrating that unlike other languages, they did not incorporate a "newlinechar" property within the RTB, but on the whole it is managable, and as well that glitch forced me to rethink how I was selecting the active command in the editor.
Thanks