Class TConstant

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TConstant = class(TObject)

Description

TConstant defines storage for a constant value such as "Abc", 1, 2.5, or True.

Hierarchy

Overview

Fields

Private FResultString: string;
Protected FResult: Pointer;
Protected FResultType: TRbwDataType;

Methods

Private procedure SetResultString(const Value: string);
Protected constructor Create(const DataType: TRbwDataType); overload;
Protected procedure MakeDiagram(List: TStringList; Level: integer); virtual;
Protected function ValueToString: string;
Public constructor Create(Value: string); overload;
Public constructor Create(const Value: Boolean); overload;
Public constructor Create(const Value: integer); overload;
Public constructor Create(const Value: double); overload;
Public destructor Destroy; override;
Public function StringResult: string;
Public function BooleanResult: boolean;
Public function IntegerResult: Integer;
Public function DoubleResult: double;
Public function Decompile: string; virtual;
Public function DecompileDisplay: string; virtual;

Properties

Protected property ResultString: string read FResultString write SetResultString;
Public property ResultType: TRbwDataType read FResultType;

Description

Fields

Private FResultString: string;

FResultString: string; See ResultString. Ordinarily access to FResultString should be avoided.

Protected FResult: Pointer;

FResult: Pointer; FResult points to the address of the result.

Protected FResultType: TRbwDataType;

FResultType: TRbwDataType; FResultType specifies what type of data is stored in FResult.

Methods

Private procedure SetResultString(const Value: string);

See ResultString.

Protected constructor Create(const DataType: TRbwDataType); overload;

Create a TConstant and specify FResultType.

Protected procedure MakeDiagram(List: TStringList; Level: integer); virtual;

MakeDiagram adds a new line to List that shows its position in a hierarchy. The new line begins with Level number of tab characters. This is followed by Decompile followed by another tab character and then Decompile again.

Protected function ValueToString: string;

Convert the result to a string.

Public constructor Create(Value: string); overload;

Create creates a TConstant and sets ResultType.

Public constructor Create(const Value: Boolean); overload;

Create creates a TConstant and sets ResultType.

Public constructor Create(const Value: integer); overload;

Create creates a TConstant and sets ResultType.

Public constructor Create(const Value: double); overload;

Create creates a TConstant and sets ResultType.

Public destructor Destroy; override;

Destroy destroys the TConstant. Do not call Destroy directly. Call Free instead.

Public function StringResult: string;

StringResult returns the value stored in TConstant if that value is a string. Other wise it generates an error.

Public function BooleanResult: boolean;

BooleanResult returns the value stored in TConstant if that value is a boolean. Other wise it generates an error.

Public function IntegerResult: Integer;

IntegerResult returns the value stored in TConstant if that value is a integer. Other wise it generates an error.

Public function DoubleResult: double;

DoubleResult returns the value stored in TConstant if that value is a integer or double. Other wise it generates an error.

Public function Decompile: string; virtual;

Decompile converts the value stored in the TConstant to a string that can be compiled into an equivalent TConstant.

Public function DecompileDisplay: string; virtual;
 

Properties

Protected property ResultString: string read FResultString write SetResultString;

if FResultType is rdtString, ResultString is the string that is stored.

Public property ResultType: TRbwDataType read FResultType;

ResultType defines the type of data stored in the TConstant.


Generated by PasDoc 0.12.1 on 2013-05-13 15:41:59