>Is there a quick way to test if any field in a record in a grid has changed.
>I need to save the record to a different table if data in any of the record's fields has changed.
>In the old days, I would make a copy of the table before allowing edits and then compare every record's field in each table when done.
>If there is an easier, faster way -- I would love to know.
GetFldState(-1) will return a string, with a byte for every field. For existing records, "1" means unchanged, "2" means changed. For example, "11211" would mean that the second field has changed (the first byte is for the "deleted" mark).
Note that the user can "touch" the data in a TextField; for example, type a character and then delete it with backspace - in this case, Visual FoxPro will also detect this as a "change". Should this be a problem, you can compare, e.g., Field1 with oldval("Field1").
All the above assumes buffering has been enabled. After a successfull TableUpdate(), both approaches would return information which means "no change".
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)