4. System Classes : ActiveField Class : SetToDefault Method
 
Share this page                  
SetToDefault Method
The SetToDefault method sets the value of the field to its default value.
This method has the following syntax:
ActiveField.SetToDefault()
Use this method to clear the field for user input. This method also resets the HasDataChanged attribute for the field to FALSE. If the field is a CompositeField, all the component fields are set to their default values as well.
A composite field is additionally affected in that a new instance of the data object is associated with the composite field. For example:
tablefield.SetToDefault();
creates a new, empty array for the table field.
To set all fields in the frame to their default value, use the following 4GL code:
CurFrame.TopForm.SetToDefault();
CurFrame.StartMenu.SetToDefault();
This code also sets all MenuList and MenuToggle fields associated with the form to their default values. (MenuList and MenuToggle fields are the only menu fields that have default values.)