Programming Guide



sm_cl_all_mdts

Clears the mdt property for all occurrences

void sm_cl_all_mdts(void);

Description

sm_cl_all_mdts resets to PV_NO the mdt property of all occurrences, onscreen and off, for every field on the current screen. This property indicates whether the data in an occurrence has changed since screen entry.

Panther sets an occurrence's mdt property to PV_YES when it is modified after screen entry, either because of keyboard entry or a call to a function like sm_putfield. A field undergoes validation only if its mdt property is set to PV_YES.

You can clear an individual occurrence, set its mdt property to PV_NO.

Example

 /* Clear mdt property for all fields on the screen.
* Then write data to the last field, and check that its
* mdt property is the only one set. */

vars ct
vars not_modified = 1
vars total_fields = @screen("@current")->numflds

call sm_cl_all_mdts()
@field_num(total_fields) = "Hello" // modify last field

for ct = 1 while ct <= total_fields && not_modified
{
if @field_num(ct)->mdt == PV_YES
not_modified = 0
}
ct = ct - 1 // remove last increment of counter

if ct == total_fields && !not_modified
msg emsg("last field is the only one modified")
else if ct < total_fields
msg emsg("Something is rotten here")
else
msg emsg("Nothing has changed")
return

See Also

sm_tst_all_mdts