Try OpenEdge Now
skip to main content
ABL Reference
Handle Attributes and Methods Reference : ADD-CALC-COLUMN( ) method


Creates a browse column from the specified properties and returns the handle of the new column. This method can be used only after the browse's query attribute has been set.
Return type: HANDLE
Applies to: BROWSE widget


ADD-CALC-COLUMN ( datatype-exp , format-exp , initial-value-exp , label-exp
  [ , pos [ , widget-type]] )
Character expression specifying the data type. Valid values are "CHARACTER", "DATE", "DECIMAL", "INTEGER", "INT64", or "LOGICAL".
Character expression specifying the column's format.
Character expression specifying the initial value. This may be a null string.
Character expression specifying the column's label.
The optional integer value position of the browse column. If pos = 2, the column is the second column. If the position is not specified or the position is invalid, the new column is added at the end of the columns.
An optional character expression specifying the widget type of the column. Valid values are "COMBO-BOX", "DROP-DOWN", "DROP-DOWN-LIST", "FILL-IN" and "TOGGLE-BOX". The default value is "FILL-IN".
If datatype-exp is not "LOGICAL", specifying "TOGGLE-BOX" as the widget type generates a run-time error.
The widget-type parameter is ignored in character mode.
The following is an example of adding a column in the browse's fifth position using this method:
CalcHnd5 = BrwsHndl:ADD-CALC-COLUMN("char", "AAA-99999", "ORD-37854", "OrdNum", 5).
The ADD-CALC-COLUMN( ) method may be used on a static browse as well as on a dynamic browse.
If the browse is already displayed, the REFRESH( ) method should be applied to the browse after columns are added using ADD-CALC-COLUMN( ). This will initially populate the viewport for the calculated column. The ROW-DISPLAY trigger would normally populate the column, but when ADD-CALC-COLUMN is being executed, the ABL calc-column handle is not yet set and, thus, cannot initially populate it.