>I just tested my previous solution and it doesn't work, try this one instead:
>
>Function SmallIntToNum
>LPARAMETER tcSmallInt
>
>DECLARE RtlMoveMemory IN WIN32API ;
>INTEGER @DestNumeric, ;
>STRING @pVoidSource, ;
>INTEGER nLength
>LOCAL lnNum
>
>lnNum = 0
>=RtlMoveMemory(@lnNum, tcSmallInt, 1)
>
>RETURN lnNum
>
>
>AND To move it back to a small Int Use this one
>
>Function NumToSmallInt
>LPARAMETER lnInt
>
>DECLARE RtlMoveMemory IN WIN32API ;
>STRING@DestChar, ;
>INTEGER @pVoidSource, ;
>INTEGER nLength
>
>LOCAL lcRet
>lcRet = " "
>=RtlMoveMemory(@lcRet, lnInt, 1)
>
>RETURN lcRet
I don't think this is going to work in a call to a method of an ActiveX control; IAC, you're being much too difficult in your conversion!
FUNCTION SmallIntToNum
LPARAMETER tcSmallInt
RETURN ASC(tcSmallInt)
FUNCTION NumToSmallInt
LPARAMETER tnNumber
RETURN CHR(tnNumber)
IOW, ASC() and CHR() handle the conversion on their own without resorting to an API call...
Again, I don't think this will work, because the COM interface will see any VFP variable as a VARIANT, and will need to have it's diaper changed...