>If CharVar=.F.
> Return Val(CCATSVal)
>Endif
>If CharVar=.T.
> Return CCATSVal
>Endif
>
>If it finds the field and value in that table it returns the predefined CATS value from the table. But if it doesn't find it in the convert table, I used the DBGETPROP() to pick up the default value for that field. This seems to work. However, once the replace statement is executed in the main program, the replace doesn't seem to excecute. Anyone have any suggestions on what to try.
You may try putting
lnSelect=select()
right after the Lparameter line, and
select (lnSelect)
before the block I quoted. You do a replace with a function which actually selects another table, and I'm not sure where you are when you return. It's just safer to save and restore some environment in routines like this. You may also be at Eof after this Locate (btw, you don't need the GO TOP in the function - Locate will work the same without it and you'll get some speed), so Les Pinter's answer may apply to that case.