Applies to
Declaration
procedure SaveUndo(Stream: TStream);
procedure LoadUndo(Stream: TStream);
Description
These methods help implement multi-content for TPlusMemo in your application. Method SaveUndo stores in a stream its internal undo information and state, so that they can be loaded back later with LoadUndo. When calling LoadUndo, the content of the TPlusMemo must be the same as when SaveUndo was done otherwise errors will occur.
A typical use of these methods is an application where the same TPlusMemo is used for editing many text files. Before switching to a file other than the one currently viewed or edited, SaveUndo is called with a stream created expressely for this usage (note: a TMemoryStream is well suited for that). When going back to the first file, LoadUndo is called with the stream created previously.
Remark
Before calling LoadUndo, don't forget to reset the stream position to the same value it was when SaveUndo was done.
See also
Methods Undo, Redo;
Method ClearUndo;
Properties CanUndo, CanRedo;
Properties UndoMaxLevel, UndoMaxSpace.