Page 1 of 1

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

Posted: Sat Feb 11, 2012 8:59 am
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;

Posted: Sat Feb 11, 2012 9:35 am
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.

Posted: Mon Feb 13, 2012 6:25 am
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).

Posted: Mon Feb 13, 2012 12:44 pm
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).