Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Operating System Utilities /
Chapter 4 - Date, Time, and Measurement Utilities / Date, Time, and Measurement Utilities Reference
Routines / Modifying and Verifying Long Date-Time Records


ValidDate

You can use the ValidDate 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
The ValidDate function verifies the fields, specified by the flags parameter, in the long date-time record specified by the vDate parameter. If any of the specified fields contain invalid values, the ValidDate function returns a LongDateField value indicating the field in error. Otherwise, it returns the constant validDateFields. Note that ValidDate reports only the least significant erroneous field.

The following constants specify the LongDateRec fields for the ValidDate 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
Although ValidDate does not move or purge memory, you should not call it at interrupt time.

SEE ALSO
To learn more about the LongDateTime data type, see page 4-25. For more information on the long date-time record, see page 4-26. The ToggleDate function is described on page 4-42. The enumerated type LongDateField is described on page 4-29.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996