Class TPasFieldVariable

Unit

Declaration

type TPasFieldVariable = class(TPasItem)

Description

Pascal global variable or field or nested constant of CIO.

Precise definition is "a name with some type". And Optionally with some initial value, for global variables. It also holds a nested constant of extended classes and records. In the future we may introduce here some property like Type: TPasType.

Source: source/component/PasDoc_Items.pas (line 631).

Hierarchy

Overview

Methods

Protected procedure Serialize(const ADestination: TStream); override;
Protected procedure Deserialize(const ASource: TStream); override;

Properties

Public property IsConstant: Boolean read FIsConstant write FIsConstant;

Description

Methods

Protected procedure Serialize(const ADestination: TStream); override;

This item has no description. Showing description inherited from TBaseItem.Serialize.

Serialization of TPasItem need to store in stream only data that is generated by parser. That's because current approach treats "loading from cache" as equivalent to parsing a unit and stores to cache right after parsing a unit. So what is generated by parser must be written to cache.

That said,

  1. It will not break anything if you will accidentally store in cache something that is not generated by parser. That's because saving to cache will be done anyway right after doing parsing, so properties not initialized by parser will have their initial values anyway. You're just wasting memory for cache, and some cache saving/loading time.

  2. For now, in implementation of serialize/deserialize we try to add even things not generated by parser in a commented out code. This way if approach to cache will change some day, we will be able to use this code.

Source: source/component/PasDoc_Items.pas (line 635).

Protected procedure Deserialize(const ASource: TStream); override;

This item has no description.

Source: source/component/PasDoc_Items.pas (line 636).

Properties

Public property IsConstant: Boolean read FIsConstant write FIsConstant;

Set if this is a nested constant field

Source: source/component/PasDoc_Items.pas (line 639).


Generated by PasDoc 0.17.0.snapshot.