在Delphi中存储关键字 [英] Stored keyword in Delphi
问题描述
属性字段:TIndexDefs读取FFields写入SetFields FieldsStored;
关键字的目的是什么?它是做什么的?
从我的Delphi 7帮助文件:
默认,
nodefault指令称为
存储说明符。他们对程序行为没有
的影响,但
控制是否以
格式的形式保存已发布财产的
值。
存储的指令必须遵循
,由True,False,布尔值
字段的名称或返回布尔值的无参数
方法的名称。
例如,属性名称:TComponentName读取FName写SetName存储False;
如果一个属性没有存储的指令,
就被视为存储True是
指定。
这听起来像是控制是否在.DFM文件中存储与组件相关的属性表格。 (只是一个猜测)
Delphi allows a stored keyword when defining properties as follows:
property Fields: TIndexDefs read FFields write SetFields stored FieldsStored;
What is the purpose of the keyword and what does it do?
From my Delphi 7 help file:
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.
This sounds like it controls whether or not to store a property relating to a component in the .DFM file for the form. (Just a guess though)
这篇关于在Delphi中存储关键字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!