trichview.com

trichview.support




List index out of bounds (-1).


Return to index


Author

Message

Jonas Bilinkevicius

Posted: 03/30/2004 15:58:26


Hello,


sometimes I get error


  Type   : EStringListError

  Message: List index out of bounds (-1).

  Control Class: TRVTableInplaceEdit

  TRV Version: 1.8 (Trial)


in procedure. Line #7


Unfortunately I don't understand why and how to solve it :)


1 procedure SetURLToSelection(const URL: string; Editor: TRichViewEdit);

2 var i, StartNo, EndNo, StartOffs, EndOffs: Integer;

3  rve: TCustomRichViewEdit;

4 begin

5  rve := Editor.TopLevelEditor;

6  rve.GetSelectionBounds(StartNo, StartOffs, EndNo, EndOffs, True);

7  if StartOffs >= rve.GetOffsAfterItem(StartNo) then

8    inc(StartNo);

9  if EndOffs <= rve.GetOffsBeforeItem(EndNo) then

10    dec(EndNo);

11  rve.BeginUndoGroup(rvutTag);

12  rve.SetUndoGroupMode(True);

13  for i := StartNo to EndNo do

14    rve.SetItemTagEd(i, Integer(StrNew(PChar(URL))));

15  rve.SetUndoGroupMode(False);

16 end;


--

Regards,

Jon





Powered by ABC Amber Outlook Express Converter