The TYPE() function evaluates expression passed to it not the type of the field. AFIELDS() + ASCAN() will do the trick
>I need to preprocess a table or cursor and replace all nulls with zeros for numeric fields and spaces for character, empty dates, etc.
>
>I have mytable open, it has a column - rate
>
>I put numeric data into it
>?vartype(mytable.rate) && shows N
>?type("mytable.rate") && shows N
>
>I put a null into it the data
>
>?vartype(mytable.rate) && shows X
>?type("mytable.rate") && shows N
>
>So it looks like vartype is evaluating the data type of the data in the field, whereas type is evaluating the data type of the field? In this case, what I need is the data type of the field. I guess I can rely on type for this?
>
>Ideally though I'd like to have a function like get_field_datatype(). I could create one by creating a temp table with copy structure extended and querying that table for the field's data type. I don't see though that a native function exists to do this?
--sb--