>>I need to run VFP 6 FFC code in vfp5.
>>
>>I implemented a vartype() in the vfp 5:
>>
>>func VARTYPE
>>lpara prmVAR
>>return type('m.prmVAR')
>>
>>Is this exactly the same as vfp 6 built-in vartype function?
>
>For the most part yes. I did find one instance where vartype() returned an error where type() returned a "U". Hopefully Christof will chime in because I think he has done extensive testing of this new function.
>
>Either way, you definitely need some code changing to rename your UDF and all occurrences of calling it in your apps -- which, for now, may be the safest thing to do.
There's at least one significant difference - a null variable returns 'X' from vartype(), but the last type the variable had before it was assigned a null value from TYPE(). Also, if you pass an expression to vartype() with an illegal expression in it, it generates a VFP error appropriate to the illegal expression (syntax error, data type mismatch, etc.); TYPE() simply returns 'U'.