Previous Topic: Testing Cursor PositionNext Topic: Testing for Input Conditions


Testing for Identical Data

You can compare the contents of a mapped-in field with the map data that is currently in your program's record buffer.

You can use #MAPINQ when you want to reduce the number of database I/O operations performed for your programs, updating the database only when the user enters different data.

To test for identical data, use the DATAIDEN and DATADIFF options of the IF= clause (see Testing for Input Conditions).

Example

Use a #MAPINQ statement to test whether the user has entered identical data in the EMPNUM, EMPNAME, CONCODE and UPDFLAG.

Use a #MAPINQ statement to test whether the user has entered a new department ID. If the user enters a new ID (different is true), the program branches to label OBTDEPT.

#MAPINQ MRB=BLOCK1,FLIST=(FIELD,DEPTID-0410),FOR=ANY,
      IF=(DATADIFF,OBTDEPT)