procedure ScrollToLineCol(AMemo: TCustomMemo; Line, Col: integer);
if AMemo = nil then
// Find the character number of the line requested
CharNum := AMemo.Perform(EM_LINEINDEX, Line, 0);
// Make sure we keep the column in this line
Len := AMemo.Perform(EM_LINELENGTH, CharNum, 0);
if Len > Col then
AdjCol := Col
AdjCol := Len;
// Add the column to the caret position
AMemo.SelStart := CharNum + AdjCol;
AMemo.Perform(EM_ScrollCaret, 0, 0);
Hopefully, this makes it easy to debug now!
The opinions expressed herein are my own personal opinions and do not represent
my employer's view in any way.