[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
__PACKTIME
Pack a Time formatted char variable to a word
------------------------------------------------------------------------------
Function:
__PACKTIME:FAR
Description:
This function takes a variable pointed to by DX:AX and in the form
HH:MM:SS (the format as returned by Time()) and returns the Time
compressed in a word in AX. The compressed form is the exact form as
DOS uses it. Note that an evantual Odd second is lost (there just
isn't enough room in 16 bits to store all possible values). This
means that, for instance, 12:31:29 converts to some value which will
Unpack into 12:31:28.
The time seperator might be any character, it need not be ':'. So,
HHhMMmSS is Ok, although __UNPACKTIME will always convert into
"HH:MM:SS".
Example:
if you would want a function, let's say Time2Dos() that converts a
Clipper TIME var to a DOS word, you could do as follow:
Time2Dos(cTime) --> nDOStimeValue // where cTime is "HH:MM:SS"
mov ax,1
push ax
call __PARC
add sp,2
call __PACKTIME
push ax
call __RETNI
add sp,2
ret
Note that XPpackTime() does it slightly differently, it converts AX to a
character and makes sure it can be used for comparing values.
See Also:
__PACKDATE
__UNPACKTIME
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson