TBAMoment¶
Abstract superclass for date and time attributes
Unit: BoldAttributes
Declaration¶
Hierarchy¶
- TObject
TBoldMemoryManagedObjectTBoldFlaggedObject- TBoldSubscribableObject
- TBoldElement
- TBoldDomainElement
- TBoldMember
- TBoldAttribute
- TBAMoment
- Direct subclasses
- TBADate
- TBADateTime
- TBATime
Description¶
This is an abstract superclass of the three different classes that uses TDateTime internally to store their data (TBADateTime, TBATime, TBADate). It has no public data-properties.
Properties¶
| Name | Summary | Notes |
|---|---|---|
| AsDate | protected | |
| AsDateTime | protected | |
| AsTime | protected | |
| Days | The day part of the date | protected, read-only |
| Hours | The hour part of the time | protected, read-only |
| Minutes | The minutes part of the time | protected, read-only |
| Months | The month part of the date | protected, read-only |
| Seconds | The seconds part of the time | protected, read-only |
| Years | The year part of the date | protected, read-only |
AsDate¶
AsDateTime¶
AsTime¶
Days¶
Days contains the day part of the date value. For a date 1970-03-17, Days will return 17.
See Also
Hours¶
Hours contains the hours part of the time value. For a time 10:15:16, Hours will return 10.
See Also
Minutes¶
Minutes contains the minutes part of the time value. For a time 10:15:16, Minutes will return 15.
See Also
Months¶
Months contains the month part of the date value. For a date 1970-03-17, Months will return 3.
See Also
Seconds¶
Seconds contains the seconds part of the time value. For a time 10:15:16, Seconds will return 16.
See Also
Years¶
Years contains the year part of the date value. For a date 1970-03-17, Years will return 1970.
See Also
Methods¶
| Name | Summary | Notes |
|---|---|---|
| Assign | override | |
| CanSetValue | ||
| CompareToAs | override | |
| GetAsDate | protected | |
| GetAsDateTime | protected | |
| GetAsTime | protected | |
| GetAsVariant | override | |
| MaySetValue | Override to affect the result of CanSetValue . | protected, virtual |
| SetAsDate | protected | |
| SetAsDateTime | protected | |
| SetAsTime | protected | |
| SetAsVariant | override | |
| SetEmptyValue | override |
Assign¶
This copies the data from another TBAMoment.
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 internal value to the value of the BoldElement using the CompType as follows:
- ctDate: Compares dates only
- ctTime: Compares times only
- cdDefault: Compares dates and times
The resultcodes used are:
self.[AsDate|AsTime|AsDateTime] < TBAMoment(BoldElement).[AsDate|AsTime|AsDateTime]returns -1self.[AsDate|AsTime|AsDateTime] = TBAMoment(BoldElement).[AsDate|AsTime|AsDateTime]returns 0self.[AsDate|AsTime|AsDateTime] > TBAMoment(BoldElement).[AsDate|AsTime|AsDateTime]returns 1
GetAsDate¶
GetAsDateTime¶
GetAsTime¶
GetAsVariant¶
MaySetValue¶
A subclass of TBAMoment 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.
SetAsDate¶
SetAsDateTime¶
SetAsTime¶
SetAsVariant¶
SetEmptyValue¶
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.