Programming Guide : Creating Dynamic Frames : How You Can Remove Fields Dynamically : How You Can Remove a Field from Display
 
Share this page          
How You Can Remove a Field from Display
To remove a field that was created originally in OpenROAD Workbench with a declared variable (the default behavior), you can use the field function to reference the field when setting its parent to null. The following statement removes a field created in Workbench:
field(myfield).ParentField = null;
Fields that are created dynamically, however, cannot be referenced using the field function. You must refer to these fields with the reference variable used to create them. Because the field function operates on a data variable to return its reference variable, it is irrelevant to dynamically created fields. Fields created dynamically do not have a data variable.
The following statement removes a dynamically created table field named tfield from display:
tfield.ParentField = null;
Because every field that is part of a composite field has a reference variable pointing to it in the composite's ChildFields array, you can remove all the fields in a composite by clearing that array. The following statement removes all fields in the mfield matrix field:
mfield.ChildFields.Clear();