Important: The information in this document is obsolete and should not be used for new development.
ValidDate
You can use theValidDate
function to verify specific date and time values in a long date-time record.
FUNCTION ValidDate (VAR vDate: LongDateRec; flags: LongInt; VAR newSecs: LongDateTime): Integer;
vDate
- The long date-time record whose fields you want to verify.
flags
- The fields that you want to verify in the long date-time record.
newSecs
- The date-time information, passed by the
ToggleDate
function, that you want to verify.DESCRIPTION
TheValidDate
function verifies the fields, specified by theflags
parameter, in the long date-time record specified by thevDate
parameter. If any of the specified fields contain invalid values, theValidDate
function returns aLongDateField
value indicating the field in error. Otherwise, it returns the constantvalidDateFields
. Note thatValidDate
reports only the least significant erroneous field.The following constants specify the
LongDateRec
fields for theValidDate
function to check:
CONST eraMask = $0001; {verify the era} yearMask = $0002; {verify the year} monthMask = $0004; {verify the month} dayMask = $0008; {verify the day} hourMask = $0010; {verify the hour} minuteMask = $0020; {verify the minute} secondMask = $0040; {verify the second} dateStdMask = $007F; {verify the era through } { second} dayOfWeekMask = $0080; {verify the day of the week} dayOfYearMask = $0100; {verify the day of the year} weekOfYearMask = $0200; {verify the week of the year} pmMask = $0400; {verify the evening (P.M.)}SPECIAL CONSIDERATIONS
AlthoughValidDate
does not move or purge memory, you should not call it at interrupt time.SEE ALSO
To learn more about theLongDateTime
data type, see page 4-25. For more information on the long date-time record, see page 4-26. TheToggleDate
function is described on page 4-42. The enumerated typeLongDateField
is described on page 4-29.