Language Reference Guide : System Classes : DateObject Class
 
Share this page          
DateObject Class
The DateObject class provides an object version of a date value. In most circumstances, a simple date variable is sufficient. However, sometimes a simple object variant of the date is useful.
For example, because array row references in OpenROAD must be reference variables and cannot be simple scalar variables, you cannot have an array that contains rows defined as single date elements. However, you can get the same functionality by using an array of DateObjects and referring to the Value attribute of DateObject to get or set the data.
Another common use of the DateObject class is to pass messages between concurrently executing frames with the SendUserEvent method. You cannot directly send a simple date value with the SendUserEvent method. However, you can declare a DateObject in the frame that is using the SendUserEvent and assign a simple date value to its Value attribute. For example:
/* ... declarations in initialize ... */
dval = date;
dobject = DateObject;
...
dval = '13-mar-1952';
dobject.Value = dval;
otherframe.SendUserEvent(eventname = 'someevent',
    messageobject = dobject);
...
You can then access the data in the other frame to pass a simple variable. For example:
/* ... declarations in initialize ... */
otherdval = date;
...
on userevent 'someevent' =
begin
    otherdval = DateObject(CurFrame.MessageObject).Value;
...
You reference the Value attribute when you perform date operations on a DateObject. For example:
integer = date_part('hour', dobject.Value);
Inherits From
Object Class
Inherited By
None
Attributes
Value
Methods
None