TBAFloat¶
A floating point attribute
Unit: BoldAttributes
Declaration¶
Hierarchy¶
- TObject
TBoldMemoryManagedObjectTBoldFlaggedObject- TBoldSubscribableObject
- TBoldElement
- TBoldDomainElement
- TBoldMember
- TBoldAttribute
- TBANumeric
- TBAFloat
Description¶
This attribute type can be used to store floating point values.
Properties¶
| Name | Summary | Notes |
|---|---|---|
| AsFloat | The actual floating point value | |
| AsInteger |
AsFloat¶
This is the delphi native representation of the floating point value. It can be both read and written.
AsInteger¶
The integer value of a floating point can only be written. If you want to read the integer value you must use either round(AsFloat) or trunc(AsFloat).
Methods¶
| Name | Summary | Notes |
|---|---|---|
| Assign | override | |
| AssignContentValue | protected, override | |
| AssignValue | override | |
| CanSetValue | ||
| CompareToAs | override | |
| GetAsFloat | protected, override | |
| GetAsVariant | override | |
| GetStringRepresentation | protected, override | |
| MaySetValue | Override to affect the result of CanSetValue . | protected, virtual |
| ProxyClass | protected, override | |
| ProxyInterface | override | |
| SetAsFloat | protected, virtual | |
| SetAsInteger | protected, override | |
| SetAsVariant | override | |
| SetStringRepresentation | protected, override | |
| ValidateCharacter | override | |
| ValidateString | override |
Assign¶
This will copy the numeric value from any subclass of TBANumeric.
AssignContentValue¶
AssignValue¶
CanSetValue¶
Use this function to test if it is allowed to set the attribute to a specific value.
If a subscriber is sent to the function, this subscriber will be notified if the conditions have changed (so that an illegal value is now legal). It is OK to send a nilpointer instead.
CompareToAs¶
function CompareToAs(CompType: TBoldCompareType; BoldElement: TBoldElement): Integer; override; See also Ancestor Method
This will compare the TBAFloat to any numeric value with the following result codes:
self.AsFloat < TBAFloat(BoldElement).AsFloatreturns -1self.AsFloat = TBAFloat(BoldElement).AsFloatreturns 0self.AsFloat > TBAFloat(BoldElement).AsFloatreturns 1
GetAsFloat¶
GetAsVariant¶
GetStringRepresentation¶
function GetStringRepresentation(Representation: TBoldRepresentation): string; override; See also Ancestor Method
MaySetValue¶
A subclass of TBAFloat may override this method to prohibit setting the attribute to a specific value. If the result value is false, the setting will be aborted. If it is true, there may still be other reasons why the changing of the value is not allowed.
ProxyClass¶
ProxyInterface¶
function ProxyInterface(const IId: TGUID; Mode: TBoldDomainElementProxyMode; out Obj): Boolean; override; See also Ancestor Method
SetAsFloat¶
SetAsInteger¶
SetAsVariant¶
SetStringRepresentation¶
procedure SetStringRepresentation(Representation: TBoldRepresentation; Value: string); override; See also Ancestor Method
ValidateCharacter¶
function ValidateCharacter(C: AnsiChar; Representation: TBoldRepresentation): Boolean; override; See also Ancestor Method
Returns True if C is one of '0'..'9', '-', '+', 'e', 'E' or the decimal separator.
ValidateString¶
function ValidateString(Value: string; Representation: TBoldRepresentation): Boolean; override; See also Ancestor Method
Returns true if the string can be converted to a floating point value.
Generated from the Bold 4.0 help (Help/BfD.chm) by Tools/chm2mkdocs.py; member lists reflect Bold 4.0, see the source for members added since.