7.111.2 SET Examples

This code sets the caption of #MyButton to "OK":

SET COM(#MyButton) Caption('OK')

This code disables buttons #PHBN_1 and #PHBN_2:

set COM(#phbn_1 #phbn_2) Enabled(false)

This code sets the ColumnWidth of the first grid in an ActiveX grid to 50:

SET COM(#Com_Grid) ColumnWidth<1>(50)

This code sets the caption of a label to the current value of the #SURNAME field on the form:

SET COM(#label_1) Caption(#SURNAME)

Note that if a field is used in a list-type component in a form, its current value can be passed using the field name exactly as if the actual field was on the form. So the code above would work if the form contained a list-type component which has a column with the Source property set to #SURNAME.