EListError On TRichViewEdit.Format

General TRichView support forum. Please post your questions here
Post Reply
DickBryant
Posts: 148
Joined: Wed Dec 07, 2005 2:02 pm
Contact:

EListError On TRichViewEdit.Format

Post by DickBryant »

This one's driving me nuts!

I create a document consisting of a table loaded with various entries (some of which are Unicode). I save the table to a file then call

FMain.RichViewEdit1.Clear;
FMain.RichViewEdit1.LoadRVF(StrPas(FLSFile));
FMain.RichViewEdit1.Format;

the code fails on the Format with EListError on this line with List Index Out Of Bounds (0)

FormatLine(
RV_ReturnProcessedString(Items,
RVStyle.TextStyles[GetActualStyleNo(RVStyle)], False,
rvoShowSpecialCharacters in Options, False),
Items, 0,
{$IFNDEF RVDONOTUSEUNICODE}
RVU_Length(Items, ItemOptions),
{$ELSE}
Length(Items),
{$ENDIF}
i, Canvas, sad, Params)

BUT - if I close the program and reopen it and then open the saved file (using the same code as above) it operates perfectly??

Any suggestions?

Dick
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Can this error be reproduced when loading this file in Editor1 demo on in the ActionTest?
DickBryant
Posts: 148
Joined: Wed Dec 07, 2005 2:02 pm
Contact:

Post by DickBryant »

No - if I pause the program in the IDE right after it saves the file and open the file with ActionTest.exe it opens just fine - just like it does using my own program IF I close the program first (that's the current work-around, but I'd like to get rid of it).

Can this error be caused by settings in the RVStyle? I _believe_ RVStyle has been cleared before attempting to load the saved file into RichViewEdit1 using the referenced code.

Dick
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

1) Send me this file
2) Is this really the line of code generating the exception? Compile your project without optimization and with stack frames (see project's options, compiler)
Post Reply