I try to do that this way
uses
... RVLinear;
function SelStart(RVE:TRichViewEdit):integer;
var
SelStart:integer;
SelLength:integer;
int:integer;
begin
RVGetSelection(RVE,SelStart,SelLength,int);
Result:=SelStart;
end;
When it is done with the first line, it works fine. When I go to the second line or to any other line the function returns some very big number.
How can I get SelStart?
-
- Site Admin
- Posts: 17555
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: How can I get SelStart?
The last parameter of RVGetSelection is a number of characters per a line break.
You pass an uninitialized value to the last parameter, so the results RVGetSelection become random for the second and further lines.
Normally, either 1 or 2 are used for this parameter. The default of RVGetSelection is 2.
I recommend to use the default value:
RVGetSelection(RVE,SelStart,SelLength)
You pass an uninitialized value to the last parameter, so the results RVGetSelection become random for the second and further lines.
Normally, either 1 or 2 are used for this parameter. The default of RVGetSelection is 2.
I recommend to use the default value:
RVGetSelection(RVE,SelStart,SelLength)
-
- Posts: 10
- Joined: Sat Oct 02, 2021 6:43 pm
Re: How can I get SelStart?
Thank you, it works now!