Delphi 允许在定义属性时使用存储的关键字,如下所示:
property Fields: TIndexDefs read FFields write SetFields stored FieldsStored;
关键字的目的是什么以及它的作用是什么?
最佳答案
来 self 的 Delphi 7 帮助文件:
The optional stored, default, and nodefault directives are called storage specifiers. They have no effect on program behavior, but control whether or not to save the values of published properties in form files.
The stored directive must be followed by True, False, the name of a Boolean field, or the name of a parameterless method that returns a Boolean value. For example,
property Name: TComponentName read FName write SetName stored False;
If a property has no stored directive, it is treated as if stored True were specified.
它控制是否在表单的 .DFM 文件中存储与组件相关的属性。
关于delphi - Delphi中存储的关键字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2072096/