如何以编程方式在 TBCEditor 中设置文本选择?

How to programmatically set a text-selection in TBCEditor?

我在 Delphi 10.4.1 中使用此版本的 TBCEditor:

https://github.com/maciej-izak/TBCEditor-1

当我尝试以编程方式设置文本选择时:

Editor.SelectionBeginPosition.Line := i;

...然后编译器显示此错误消息:

[dcc32 Error] Form1.pas(422): E2064 Left side cannot be assigned to

那么如何在 TBCEditor 中以编程方式设置文本选择?

我从未使用过该控件,但我查看了 source code 并在第 652 行找到了一个似乎可以满足您的要求的方法:SetCaretAndSelection.