Programming Guide



sm_tst_all_mdts

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.

Environment

C only

Returns

Description

sm_tst_all_mdts tests the mdt property of all onscreen and offscreen occurrences of all fields on the current screen. If it finds an occurrence with its mdt property set to PV_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's mdt property was last cleared.

Note: sm_tst_all_mdts does not test for insertion or deletion of occurrences; it only tests the mdt property of existing occurrences.

Example

#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.");