RWDateTime Sentinels
RWDateTime has the ability to hold sentinel values that are not necessarily dates, but are convenient to use as comparison values within applications. For example, a “future” sentinel provides a value that represents a date larger than the largest RWDateTime. RWDateTime currently provides four internal, pre-defined sentinels and can accommodate up to 128 user-defined sentinels. The RWDateTime sentinels are described in the following sections.
Table 3 summarizes the responses of
RWDateTime operations when applied to various sentinels. The sections that follow
Table 3 provide more information about the sentinels.
Table 3 – RWDateTime sentinels
Operator/Function | Valid | Null | Invalid | Past/Future | User Sentinel |
---|
Extract Part | OK | throw | throw | throw | throw |
Arithmetic | OK | Propagate to Invalid | Propagate | Propagate Past/Future | Propagate to Invalid |
Relational | OK | OK | OK | OK | OK |
asString()/Output | OK | “NULL” | “#INVALID#” | “#INVALID#” | “#>num<#” |
Read String | OK | N/A | OK | N/A | N/A |
Create | OK | OK | OK | OK | OK |
NOTE: Attempting to calculate the time differential between two
RWDateTime objects (utilizing the – operator) results in the throwing of an
RWInternalErr if either of the
RWDateTime objects are sentinels.