Class TDOMElementScriptHelper

Unit

Declaration

type TDOMElementScriptHelper = class helper(TDOMElementHelper) for TDOMElement

Description

Class helper to read CastleScript expressions from DOM (XML files). Use this unit, and then you can call powerful methods AttributeFloatExpression, AttributeFloatExpressionDef instead of the TDOMElementHelper.AttributeFloat, TDOMElementHelper.AttributeFloatDef.

Hierarchy

Overview

Methods

Public function AttributeFloatExpression(const AttrName: string; var Value: Float): boolean;
Public function AttributeFloatExpression(const AttrName: string): Float;
Public function AttributeFloatExpressionDef(const AttrName: string; const DefaultValue: Float): Float;

Description

Methods

Public function AttributeFloatExpression(const AttrName: string; var Value: Float): boolean;

Read from Element attribute value as a Float expression, and returns True. The expression can be anything in CastleScript https://castle-engine.io/castle_script.php , for example something crazy like 2.0 * sin(5.0) + Pi. You can use this method instead of AttributeFloat to easily allow mathematical exressions in XML attributes.

If there is no such attribute returns False and does not modify Value.

Public function AttributeFloatExpression(const AttrName: string): Float;

Retrieves from Element given attribute as a Float expression, raises EDOMAttributeMissing if missing.

The expression can be anything in CastleScript https://castle-engine.io/castle_script.php , for example something crazy like 2.0 * sin(5.0) + Pi. You can use this method instead of AttributeFloat to easily allow mathematical exressions in XML attributes.

Exceptions raised
EDOMAttributeMissing
Public function AttributeFloatExpressionDef(const AttrName: string; const DefaultValue: Float): Float;

Retrieves from Element given attribute as a Float expression, or a default value.

The expression can be anything in CastleScript https://castle-engine.io/castle_script.php , for example something crazy like 2.0 * sin(5.0) + Pi. You can use this method instead of AttributeFloatDef to easily allow mathematical exressions in XML attributes.


Generated by PasDoc 0.16.0.