Programming Guide |
Clears the mdt property for all occurrences
void sm_cl_all_mdts(void);
sm_cl_all_mdts
resets toPV_NO
themdt
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 toPV_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 itsmdt
property is set toPV_YES
.You can clear an individual occurrence, set its
mdt
property toPV_NO
.
/* 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