参考下VCL里的TRecall类TRecall acts as a temporary repository for the properties of a persistent object. To use TRecall Create an instance of TRecall, assigning an object to use for storing property values (the storage object), and an object whose property values it represents (the reference object). When you create an instance of TRecall, it automatically stores the current properties of the reference object. Call the Store method at any time to take a snapshot of the reference object's properties. TRecall updates the storage object so that it reflects only the property settings from the last time you called the Store method (or, if Store was never called, from the point when the TRecall object was created). Delete the TRecall object to restore the reference object to the set of properties it had when you last called the Store method. If you do not want the TRecall object to restore the properties it is saving, call the Forget method. After you call Forget, the TRecall object can't be used. It does not update the reference object when destroyed and can't save any more properties. You can use TRecall to save the properties of any persistent object, using any explicitly specified storage object. In addition, TRecall has several descendants with their own built-in storage objects that work only with a specific class of reference object. These include TFontRecall, TPenRecall, and TBrushRecall.
Create an instance of TRecall, assigning an object to use for storing property values (the storage object), and an object whose property values it represents (the reference object). When you create an instance of TRecall, it automatically stores the current properties of the reference object.
Call the Store method at any time to take a snapshot of the reference object's properties. TRecall updates the storage object so that it reflects only the property settings from the last time you called the Store method (or, if Store was never called, from the point when the TRecall object was created).
Delete the TRecall object to restore the reference object to the set of properties it had when you last called the Store method.
If you do not want the TRecall object to restore the properties it is saving, call the Forget method. After you call Forget, the TRecall object can't be used. It does not update the reference object when destroyed and can't save any more properties. You can use TRecall to save the properties of any persistent object, using any explicitly specified storage object. In addition, TRecall has several descendants with their own built-in storage objects that work only with a specific class of reference object. These include TFontRecall, TPenRecall, and TBrushRecall.
如 病人自感恶心,并有
呕吐腹泻,这样描述也是可理解的。楼主是在做HIS吗。建议用Rx控件包中的RichEdit那个封装的比较好些,并且是免费的。现在我可以处理诸如按"DELETE“键删除做标记;按”backspace“键删除做标记,插入等做标记,但是我的问题是我需要记录哪些信息才合适,目的是我把文件保存重新打开后要重新将这些标记的信息重新标识出来。
我现在的思路是用一个列表来记录一个包含有用户号、操作时间,操作开始位置和操作长度,操作者的REVINDEX号等信息,在保存的时候将这些记录下来,然后再回放,但是这种思路存在几个问题:
1、当有信息输入的时候,不会去遍历一遍列表修改相应的记录的操作开始位置吧;
2、当打开文件时,我要对列表进行便利;
以上两个问题会造成性能上的问题; 另外,我跟踪过,当richedit保存的时候,只是标记了“<reserved>”,但是不能记录以上我所说的痕迹信息。按照rtf规范直接写串都不行。