Sets the library return value to a datetime.
void _RetDateTimeStr(char FAR *string)
char FAR *string; /* Datetime string. */ |
Remarks
Specify the datetime string in mm/dd/year hh:mm:ss format, in which the year may be either two or four digits. See CTOT( ) Function for a list of valid datetime formats for the datetime string.
For more information on how to create an API library and integrate it with Visual FoxPro, see Accessing the Visual FoxPro API.
Example
The following example converts a date type value to datetime type value.
Visual FoxPro Code
Copy Code | |
|---|---|
SET LIBRARY TO RETDT
? xctot("2/16/95 12:07am") | |
C Code
Copy Code | |
|---|---|
#include <pro_ext.h>
void FAR datetime(ParamBlk FAR *parm)
{
MHANDLE mh;
char FAR *instring;
if ((mh = _AllocHand(parm->p[0].val.ev_length + 1)) == 0) {
_Error(182); // "Insufficient memory"
}
_HLock(parm->p[0].val.ev_handle);
instring = _HandToPtr(parm->p[0].val.ev_handle);
instring[parm->p[0].val.ev_length] = '\0';
_RetDateTimeStr(instring);
_HUnLock(parm->p[0].val.ev_handle);
}
FoxInfo myFoxInfo[] = {
{"XCTOT", (FPFI) datetime, 1, "C"}
};
FoxTable _FoxTable = {
(FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo
}; | |
See Also
Microsoft Visual FoxPro 9 SP2 Help file, VFPX Edition v1.08Send feedback on this topic to the VFPX Help file project team.
2009-2017 Placed under Creative Commons licensing by Microsoft Corporation.