problem with checkpoint - add

General TRichView support forum. Please post your questions here
Post Reply
alexandreq
Posts: 184
Joined: Wed Jan 18, 2012 6:22 pm

problem with checkpoint - add

Post by alexandreq »

Hello sergey

I did this code to create several checkpoints.

var
str : string;
Editor : TDBSRichViewEdit;
begin
PegaEditor(Editor); // get the active editor
str := Editor.RichViewEdit.GetSelTextW;
if str='' Then Begin
ShowMessage('No word to create checkpoint');
end else begin
if Editor.RichViewEdit.CanChange Then Begin
Editor.RichViewEdit.AddNamedCheckpoint(Str);
Editor.RichViewEdit.Format;
Qtextos.Post;
end;
CarregaCheckPoint; // procedure Load CheckPoints into a listbox
end;

I am having the following problem:

1) I can only create one checkpoint
2) My text isn't being save with checkpoint created.

Why?

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

Post by Sergey Tkachenko »

1) A checkpoint mark a position in the document. It cannot mark a selected fragment or any range of text.
2) AddNamedCheckpoint adds a checkpoint to the end of the document.

I recommend using InsertCheckpoint, GetCheckpointAtCaret, RemoveCheckpointAtCaret methods. They are editing methods, so you do not need CanChange, Format. Post is optional, if you want to save changes to DB immediately.
Post Reply