JavaScript Editor js editor     Web development 

Main Page

Sets the library return value to a date.

void _RetDateStr(char FAR *string)
char FAR *string;            /* Date string. */


Specify the date string in mm/dd/year format, in which the year may be either two or four digits.

For more information on how to create an API library and integrate it with Visual FoxPro, see Accessing the Visual FoxPro API.


The following example converts a character string into a date data type and returns it to Visual FoxPro.

Visual FoxPro Code

В Copy Code
? DATES("02/16/95")  && returns date {02/16/95}

C Code

В Copy Code
#include <pro_ext.h>

void FAR dates(ParamBlk FAR *parm)
   MHANDLE mh;
   char FAR *instring;

   if ((mh = _AllocHand(parm->p[0].val.ev_length + 1)) == 0) 
      _Error(182); // "Insufficient memory"
   instring = _HandToPtr(parm->p[0].val.ev_handle);
   instring[parm->p[0].val.ev_length] = '\0';

FoxInfo myFoxInfo[] = {
   {"DATES", (FPFI) dates, 1, "C"}
FoxTable _FoxTable = {
   (FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo

See Also

JavaScript Editor js editor     Web development