Important: The information in this document is obsolete and should not be used for new development.
StringToTime
TheStringToTime
function parses a string for a time specification and converts the date information into values in a date-time record. At the beginning of the string, it expects a time specification in a format defined by the current script. It returns a status value that indicates the confidence level for the success of the conversion.
FUNCTION StringToTime(textPtr: Ptr; textLen: LongInt; theCache: DateCachePtr; VAR lengthUsed: LongInt; VAR dateTime: LongDateRec): StringToDateStatus;
textPtr
- A pointer to the text string to be parsed.
textLen
- The number of bytes in the text string.
theCache
- A pointer to the date cache record initialized by the
InitDateCache
function with data that is used during the conversion process.lengthUsed
- On output, contains the number of bytes of the string that were parsed for the time.
dateTime
- On output, this
LongDateRec
record contains the hour, minute, and second values that were parsed for the time.DESCRIPTION
StringToTime
parses the string until it has finished finding all time information or until it has examined the number of bytes specified bytextLen
. It returns a status value that indicates the confidence level for the success of the conversion.Note that
StringToTime
fills in only the hour, minute, and second;StringToDate
fills in the year, month, day, and day of the week. You can use these two routines sequentially to fill in all of the values in aLongDateRec
record.
StringToTime
assigns to itslengthUsed
parameter the number of bytes that it used to parse the date.
StringToTime
returns the same status value indicator type as doesStringToDate
: a set of bit values that indicate confidence levels, with higher numbers indicating low confidence in how closely the input string matched what the routine expected. The possible values of this type are described in Table 5-5 on page 5-33.SPECIAL CONSIDERATIONS
StringToTime
may move memory; your application should not call this function at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theStringToTime
function are
Trap macro Selector _ScriptUtil $8214 FFF4