Programming Guide |
Finds the first modified occurrence on the current screen
int sm_tst_all_mdts(int *occurrence);
occurrence
- On output, the address of a variable that contains the number of the first modified occurrence.
C only
- 1 The number of the first field on the current screen that contains a modified occurrence. In this case, the number of the first occurrence that has its
mdt
property set toPV_YES
is returned in the variable addressed byoccurrence
.
- 0 No occurrence on the current screen has its
mdt
property set toPV_YES
.
sm_tst_all_mdts
tests themdt
property of all onscreen and offscreen occurrences of all fields on the current screen. If it finds an occurrence with itsmdt
property set toPV_YES
, the function returns with the base field and occurrence number. Use this function to ascertain whether any occurrence has been modified on the screen, either from the keyboard or by the application program, since the screen was displayed or since the occurrence'smdt
property was last cleared.Note:
sm_tst_all_mdts
does not test for insertion or deletion of occurrences; it only tests themdt
property of existing occurrences.
#include <smdefs.h>
/* Clear mdt property for all fields on screen;
* then write data to last field, and check
* that its mdt property is the first one set.
*/
int occurrence;
int numflds;
sm_cl_all_mdts();
numflds = sm_prop_get_int(PR_CURSCREEN, PR_NUMFLDS);
sm_putfield(numflds, "Hello");
if (sm_tst_all_mdts(&occurrence) !=
sm_prop_get_int(PR_CURSCREEN, PR_NUMFLDS))
ferr_reset(0,
"Something is rotten in the state of Denmark.");