Hi, I have a need to replicate the descend function outside of Xbase++ (if FoxPro) so I'm trying to create a function which produces the same result as the Xbase++ DESCEND(). I believe I have it figured out for data types, "C","L","N" but not for Dates. I found the source code for Harbour's DESCEND() at: https://github.com/vszakats/harbour-core/blob/f6a35f2/src/rtl/descend.c#L63 Looking at the code the relevant lines for data type Date appears to be: else if( HB_IS_DATE( pItem ) ) hb_retnl( 5231808 - hb_itemGetDL( pItem ) ); I'm assuming that hb_itemGetDL( pItem ) returns some sort of numerical value but not sure how to replicate it. Does anyone have any ideas? In "playing" with the Xbase++ DESCEND() function I have found that it returns: for DD/MM/YYYY of 01/08/9612 --> 0 and for 01/01/0001 --> 2779897 My uDescend() function is as follows... FUNCTION uDescend(xVal) LOCAL xDescend,; nAsc,; nPnt,; cValType cValType := VALTYPE(xVal) IF cValType == "A" // Works xDescend := "" FOR nPnt := 1 TO LEN(xVal) nAsc := 255-ASC(cText[nPnt]) xDescend += CHR(nAsc) NEXT nPnt ELSEIF cValType == "N" // Works xDescend := -xVal ELSEIF cValType == "L" // Works xDescend := ! xVal ELSEIF cValType == "D" // Needs Work!!! *xDescend := 5231808 - xVal ENDIF RETURN xDescend Any assistance would be appreciated! Thanks... Jonathan