Important: The information in this document is obsolete and should not be used for new development.
ValidDate
You can use theValidDatefunction 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
ToggleDatefunction, that you want to verify.DESCRIPTION
TheValidDatefunction verifies the fields, specified by theflagsparameter, in the long date-time record specified by thevDateparameter. If any of the specified fields contain invalid values, theValidDatefunction returns aLongDateFieldvalue indicating the field in error. Otherwise, it returns the constantvalidDateFields. Note thatValidDatereports only the least significant erroneous field.The following constants specify the
LongDateRecfields for theValidDatefunction 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
AlthoughValidDatedoes not move or purge memory, you should not call it at interrupt time.SEE ALSO
To learn more about theLongDateTimedata type, see page 4-25. For more information on the long date-time record, see page 4-26. TheToggleDatefunction is described on page 4-42. The enumerated typeLongDateFieldis described on page 4-29.