How can I load a rvf-file to a wanted position

General TRichView support forum. Please post your questions here
Post Reply
j&b
Posts: 184
Joined: Mon Sep 05, 2005 1:35 pm

How can I load a rvf-file to a wanted position

Post by j&b »

if pos(ExtractFileExt(s),'.rvf,.RVF')>0 then begin //Datei kann NICHT eingefügt/angehängt werden
RVSetLinearCaretPos(memo,memoPos); //memoPos is wanted position
if memo.LoadRVF(s)=false then
if MessageDlg(s+#10#10+'Fehler beim Laden der RVF-Datei !'+#10#10+
'Laden insgesamt abbrechen ? '+#10, mtConfirmation, [mbYes,mbNo],0) = mrYes then exit;
end;
memo.Change;
Memo.Format;
if table1.state in [dsEdit, dsInsert] then table1.post;
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

If you want to insert in the caret position, use InsertRVFFromFileEd. This is an editing method, so you do not need calling Change and Format.
j&b
Posts: 184
Joined: Mon Sep 05, 2005 1:35 pm

Post by j&b »

you write "you do not NEED calling Change and Format".

If i Delete these 2 lines all ok.

I think it's better to say "you MUST not write", because "need" means (?) "you can" or "you cannot" (it does not matter if you write it or not).
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Well, nothing too bad happens if you leave Change and Format.

Calling Change after InsertRVFFromFileEd is harmless. Just not necessary.
Format moves the caret to the beginning of the document (and it may be slow for large documents).
Post Reply