PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Use conditions
  • Equivalence TableSelect
  • Value of the selected element
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Returns the index of the selected element in the Table or TreeView Table control. This index can correspond to:
  • the number of the selected row. The selected row corresponds to the current row on which the selection bar is displayed.
  • the number of the selected column if the control allows the selection mode by column. This option can be configured in the "UI" tab of the control description.
  • the number of the selected cell if the controls allows the selection mode by cell. This option can be configured in the "UI" tab of the control description.
  • the column number of the selected cell if the controls allows the selection mode by cell. This option can be configured in the "UI" tab of the control description.
Example
// Index of the selected row in the "TABLE_Product" control
ResSelect = TableSelect(TABLE_Product)
// Rows selected in a multi-selection Table control populated programmatically
FOR i = 1 _TO_ TableSelectCount(TABLE_TABLE1)
Trace("Selected element: " + TableSelect(TABLE_TABLE1, i))
END
 
// Equivalent to:
// i is int
// FOR EACH SELECTED ROW i OF TABLE_TABLE1
// Trace("Selected element: " + TableSelect(TABLE_TABLE1, i-1))
// END
// Delete all selected rows from a Table control
// TableDeleteSelect can also be used
i is int
NbSelection is int
NbSelection = TableSelectCount(TABLE_MyTable)
FOR i = NbSelection TO 1 STEP -1
TableDelete(TABLE_MyTable, TableSelect(TABLE_MyTable, i))
END
Syntax
<Result> = TableSelect(<Table control> [, <Rank> [, <Information to return>]])
<Result>: Integer
  • Index of the selected element in the specified Table control,
  • -1 if no element is selected.
<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.
<Rank>: Optional integer
Rank of selection for a multi-selection control. If this parameter is not specified, the index of the first selected row is returned.
For example, to retrieve the first selected element, <Rank> = 1.
To retrieve the second selected element, <Rank> = 2, etc.
<Information to return>: Optional Integer constant
Type of information to return:
tsCellColumn<Result> will correspond to the column number for the selected cell.
tsCellLine<Result> will correspond to the row number for the selected cell.
tsColumn<Result> will correspond to the number of the selected column.
tsRow
(Default value)
<Result> will correspond to the number of the selected row.
If this parameter is not specified, the function will return the number of the selected line.
AndroidiPhone/iPad This parameter is not available. The function will return the number of the selected row.
Remarks

Use conditions

TableSelect 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. For multi-selection Table controls, you must use TableSelect in a loop to get all the selected rows.

Equivalence TableSelect

The following syntaxes are equivalent:
Index is int
Index = <Table control>
or
Index = TableSelect(<Table control>)

Value of the selected element

To retrieve the value of the selected element, the syntax is:
Index is int
Index = TableSelect(<Table control>)
<Element value> = <Table control> [Index]
or
<Element value> = <Table control> [<Table control>]
Component: wd270obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment