Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stored keyword in Delphi

Tags:

delphi

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?

like image 301
JPvdMerwe Avatar asked Jan 15 '10 14:01

JPvdMerwe


2 Answers

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)

like image 99
cmw Avatar answered Nov 05 '22 05:11

cmw


This keyword determines if a property value should be saved in a form file; it is true by default. It can be useful to avoid, for example, saving big chunks of binary information in your .dfm file (for example, an image component that must read its contents at runtime only.)

like image 7
Leonardo Herrera Avatar answered Nov 05 '22 05:11

Leonardo Herrera