|
|
|
|
TableSelectCount (Function) In french: TableSelectOccurrence Returns the number of selected elements in a Table or TreeView Table control (especially for a multi-selection control). The number of selected elements can correspond to: - the number of selected rows (current rows onto which the selection bar is displayed).
- the number of selected cells if the controls allows the selection mode by cell. This option can be configured in the "UI" tab of the control description.
- the number of selected columns if the control allows the selection mode by column. This option can be configured in the "UI" tab of the control description.
// Traces the content of the selected rows // (The Table control is a multi-selection Table control) i is int NbSelected is int NbSelected = TableSelectCount(TABLE_Product) FOR i = 1 TO NbSelected Trace("Selected row: " + ... TABLE_Product[TableSelect(TABLE_Product, i)]) END
// Deletes all selected rows from a Table control // (The Table control is a multi-selection Table control) // TableDeleteSelect is available from version 18 i is int NbSelection is int = TableSelectCount(TABLE_MyTable) FOR i = NbSelection TO 1 STEP -1 TableDelete(TABLE_MyTable, TableSelect(TABLE_MyTable, i)) END
Syntax
<Result> = TableSelectCount(<Table control> [, <Information to return>])
<Result>: Integer - Number of selected rows in the specified control,
- 0 if no row is selected.
This number can be greater than 1 for multi-selection controls.
<Table control>: Control name Name of the control to be used. This control can correspond to: - a Table control.
- a TreeView Table control.
If this parameter corresponds to an empty string (""), the control to which the current event belongs is used. A WLanguage error occurs if this parameter does not correspond to the name of a Table or TreeView Table control. <Information to return>: Integer constant Type of information to return: | | tsCell | <Result> will correspond to the number of selected cells. | tsColumn | <Result> will correspond to the number of selected columns. | tsRow (Default value) | <Result> will correspond to the number of selected rows. |
If this parameter is not specified, the function will return the number of selected rows. Remarks Use conditions TableSelectCount can be used on: - a Table or TreeView Table control based on a data file.
- a Table or TreeView Table control populated programmatically.
- a single-selection or multi-selection control.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|