| Wouldn't it be easier just to write out OA$USER, OA$DATE, the complete
old record and the complete new record? Then run a program (later) to
compare them and produce the audit of what changed?
Just a thought,
Dave.
|
| You could do /PRE and /POST form qualifiers where the /PRE saves the
current values of all fields on the form to temp symbols and the /POST
checks the current field values against those saved and writes the
field names of all fields which are different.
For example:
/PRE='xop "~~SAVE_VALUES~~"'
/POST='.if OA$FORM_DISPOSE eq 2 then xop "~~COMPARE_FIELDS~~"'
;;~~SAVE_VALUES~~;;
get #FIELD1 = FIELD1\
get #FIELD2 = FIELD2\
.
.
.
;;~~COMPARE_FIELDS~~;;
display Writing data to file...\
force\
text_file open OUTPUT FILE.NAME /write\
get #CHANGE = "N"\
.if #FIELD1 nes FIELD1 then
get #CHANGE = "Y"\\
text_file write OUTPUT "FIELD1"\
.if #FIELD2 nes FIELD2 then
get #CHANGE = "Y"\\
text_file write OUTPUT "FIELD2"\
.
.
.
.if #CHANGE = "Y" then
text_file write OUTPUT OA$DATE_NBS " " OA$USER\\
text_file write OUTPUT "****************************"
Note: This is untested code - use at your own risk.
The advantage of Dave's approach is that this checking would not be done
while the user is waiting on it, but my guess is that unless your using
this form for data entry (i.e., in lieu of keypunch) the user won't
be that annoyed with the delay. Try it and see how significant it is on
your system.
|