Large Page, Howto determine if anything modified

I’m working with some large pages with many fields. I’m looking for the best way to determine if any field has been modified?

Found what I was looking for…, the page-level control variable.

NATPAGE property natcv

/*( PROCESS PAGE
PROCESS PAGE (CV=CV-PAGE) U’/demo1/CVPAGE4’ WITH
PARAMETERS

define data local
1 cv-page(C)

if cv-page modified
write ‘modified’
else
write ‘not modified’
end-if

Be VERY, VERY careful with IF MODIFIED. I t often does not do what you think it will do. Consider:

DEFINE DATA LOCAL
1 #CV (C)
1 #A (A3) INIT <‘AAA’>
1 #B (A3) INIT <‘BBB’>
1 #C (A3) INIT <‘CCC’>
END-DEFINE
*
INPUT (AD=M CV=#CV) 5/10 #A 7/10 #B 9/10 #C
*
IF #A = ‘XXX’
REINPUT ‘XXX NOT ALLOWED FOR #A
END-IF
IF #CV MODIFIED
WRITE ‘YES MODIFIED’
ELSE
WRITE ‘NOT MODIFIED’
END-IF
END

Run the program. Change #A to XXX. When “caught” by the REINPUT, re-enter AAA for #A. Hit enter.

Would you want modified or not modified? If you would want NOT MODIFIED, you are out of luck. Natural will tell you it was modified. You can also create examples where Natural will tell you NOT MODIFIED when you would probably want to see MODIFIED.

Here is a slightly modified example:

DEFINE DATA LOCAL
1 #CV (C)
1 #A (A3) INIT <‘AAA’>
1 #B (A3) INIT <‘BBB’>
1 #C (A3) INIT <‘CCC’>
END-DEFINE
*
INPUT (AD=M) 5/10 #A 7/10 #B 9/10 #C (CV=#CV)
*
IF #A = ‘XXX’
REINPUT FULL ‘XXX NOT ALLOWED FOR #A
END-IF
IF #CV MODIFIED
WRITE ‘YES MODIFIED’
ELSE
WRITE ‘NOT MODIFIED’
END-IF
END

When the screen comes up enter XXX for #a and XXX for #C. When you get the REINPUT error message, enter anything for #a except XXX. You will be told #C was NOT MODIFIED.

I do not use this facility. I use the old standby, old and new values.