TRichview Format Error
Posted: Sun May 04, 2008 4:57 pm
Hi Sergey,
I'm trying to track down a problem I'm having with the following code sequence:
FMain.RichViewEdit1.Clear;
FMain.RichViewEdit1.Format;
FMain.RVStyleQ.TextStyles.Clear;
<some intervening if/then logic here>
FMain.RichViewEdit1.Clear;
FMain.RichViewEdit1.LoadRVF(StrPas(FLSFile));
FMain.RichViewEdit1.Format;
This is the primary sequence via which each file is loaded into the program. Normally, it works just fine. BUT in an operation sequence where the program has just created a new FLS file by overwriting an older one, then closing it, and then attempting to open it, the above sequence fails with a ListIndexOutOfBounds error in FormatLine.
However, if I exit the program after the creation of the file. Then reopen the program and open the new FLS file there is no error. Can you suggest something I may need to do to 'fully initialize' the RVE so that the sequence above will work without closing the program and reopening it? When not running this particulary import sequence, the program can open and close multiple FLS files with no problem.
The current version of the program actually DOES close after this particular import operation, prompting the user to restart and open the new file to get around this issue, but I would like to remove this inconvenience.
Thanks, As Always, For Your Help
I'm trying to track down a problem I'm having with the following code sequence:
FMain.RichViewEdit1.Clear;
FMain.RichViewEdit1.Format;
FMain.RVStyleQ.TextStyles.Clear;
<some intervening if/then logic here>
FMain.RichViewEdit1.Clear;
FMain.RichViewEdit1.LoadRVF(StrPas(FLSFile));
FMain.RichViewEdit1.Format;
This is the primary sequence via which each file is loaded into the program. Normally, it works just fine. BUT in an operation sequence where the program has just created a new FLS file by overwriting an older one, then closing it, and then attempting to open it, the above sequence fails with a ListIndexOutOfBounds error in FormatLine.
However, if I exit the program after the creation of the file. Then reopen the program and open the new FLS file there is no error. Can you suggest something I may need to do to 'fully initialize' the RVE so that the sequence above will work without closing the program and reopening it? When not running this particulary import sequence, the program can open and close multiple FLS files with no problem.
The current version of the program actually DOES close after this particular import operation, prompting the user to restart and open the new file to get around this issue, but I would like to remove this inconvenience.
Thanks, As Always, For Your Help