TAdvMemo select

I am trying to write an OnGutterClick event to select the entire line. I am an experienced Delphi programmer but somehow have managed , up until now, to avoid dealing with memos. I adapted some code from online resources and tried this:

  with AdvMemo1 do
  begin
    SetCursor(0, LineNo);
    SelStart := Perform(EM_LINEINDEX, LineNo, 0) ;
    SelLength := Length(Lines[LineNo]);
  end;
which sets the cursor on the clicked line, but starts the selection at the beginning of the first line, i.e. Line[0]. The length of the selection is the length of the clicked line, so that part works.

Apparently, SelStart := Perform(EM_LINEINDEX, LineNo, 0) doesn't do what I need, which is to start the selection at the beginning of the clicked line. How can I do that?

Thanks,
Don Mided