SELECT YourVFPCursorName SCAN FOR i = 1 TO FCOUNT("YourVFPCursorName") cFldName = "YourVFPCursorName."+FIELDS(i) DO CASE CASE ISNULL(&cFldName) AND TYPE(cFldName) $ "DT" && Date "D" and DateTime "T" Types REPLACE &cFldName WITH {} CASE ISNULL(&cFldName) AND TYPE(cFldName) $ "NY" && Numeric "N" and Money "Y" Types REPLACE &cFldName WITH 1 && (I don't know what is the difference between 8 and 7 types in VB) CASE ISNULL(&cFldName) AND TYPE(cFldName) $ "CM" && Character "C" and Memo "M" Types REPLACE &cFldName WITH "" ENDCASE ENDFOR ENDSCANor whith less code (I didn't say it is faster :o):
SELECT YourVFPCursorName FOR i = 1 TO FCOUNT("YourVFPCursorName") cFldName = "YourVFPCursorName."+FIELDS(i) DO CASE CASE TYPE(cFldName) $ "DT" && Date "D" and DateTime "T" Types REPLACE &cFldName WITH {} FOR ISNULL(&cFldName) ALL CASE TYPE(cFldName) $ "NY" && Numeric "N" and Money "Y" Types REPLACE &cFldName WITH 1 FOR ISNULL(&cFldName) ALL CASE TYPE(cFldName) $ "CM" && Character "C" and Memo "M" Types REPLACE &cFldName WITH "" FOR ISNULL(&cFldName) ALL ENDCASE ENDFOR