PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Use conditions
  • Equivalence TableSelect
  • Value of selected element
  • Selection at cell level
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Returns the subscript of selected element in the Table or TreeView Table control. This subscript can correspond to:
  • the number of the selected row. The selected row corresponds to the current row on which the selection bar is displayed.
  • Versions 16 and later
    the number of the selected column if the control allows the selection mode by column. This option can be configured in the "GUI" tab of control description.
    New in version 16
    the number of the selected column if the control allows the selection mode by column. This option can be configured in the "GUI" tab of control description.
    the number of the selected column if the control allows the selection mode by column. This option can be configured in the "GUI" tab of control description.
  • Versions 16 and later
    the number of the selected cell if the controls allows the selection mode by cell. This option can be configured in the "GUI" tab of control description.
    New in version 16
    the number of the selected cell if the controls allows the selection mode by cell. This option can be configured in the "GUI" tab of control description.
    the number of the selected cell if the controls allows the selection mode by cell. This option can be configured in the "GUI" tab of control description.
  • Versions 16 and later
    the column number of the selected cell if the controls allows the selection mode by cell. This option can be configured in the "GUI" tab of control description.
    New in version 16
    the column number of the selected cell if the controls allows the selection mode by cell. This option can be configured in the "GUI" tab of 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 "GUI" tab of control description.
Versions 16 and later
Linux This function is now available for WINDEV applications in Linux.
New in version 16
Linux This function is now available for WINDEV applications in Linux.
Linux This function is now available for WINDEV applications in Linux.
Versions 18 and later
WEBDEV - Server codePHP This function can now be used to handle the TreeView Table controls in the WEBDEV and PHP sites.
New in version 18
WEBDEV - Server codePHP This function can now be used to handle the TreeView Table controls in the WEBDEV and PHP sites.
WEBDEV - Server codePHP This function can now be used to handle the TreeView Table controls in the WEBDEV and PHP sites.
Versions 19 and later
WEBDEV - Browser code This function is now available in Browser code for Table controls in browser mode.
New in version 19
WEBDEV - Browser code This function is now available in Browser code for Table controls in browser mode.
WEBDEV - Browser code This function is now available in Browser code for Table controls in browser mode.
Versions 20 and later
Android This function is now available for Android applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 20
Android This function is now available for Android applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
Android This function is now available for Android applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
Example
// Subscript of selected row in the "TABLE_Product" control
ResSelect = TableSelect(TABLE_Product)
// Rows selected in a multiselection memory Table control
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 is available from version 18
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
  • Subscript of selected element in the specified Table control,
  • -1 if no element is selected.
<Table control>: Control name
Name of control to use. 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 multiselection control. If this parameter is not specified, the subscript of first selected row is returned.
For example, to retrieve the first selected element, <Rank> = 1.
To retrieve the second selected element, <Rank> = 2, etc.
WEBDEV - Server codePHP This parameter is available for Ajax Table controls only.
WEBDEV - Server codeWEBDEV - Browser codePHP This parameter is not available for the "classic" Table controls.
<Information to return>: Optional Integer constant
Versions 16 and later
Type of information to return:
tsColumn<Result> will correspond to the number of the selected column.
tsCellColumn<Result> will correspond to the column number for the selected cell.
tsRow
(Default value)
<Result> will correspond to the number of the selected row.
tsCellLine<Result> will correspond to the row number for the selected cell.
If this parameter is not specified, the function will return the number of the selected line.
WEBDEV - Server codeJavaPHPAjax This parameter is not available.
New in version 16
Type of information to return:
tsColumn<Result> will correspond to the number of the selected column.
tsCellColumn<Result> will correspond to the column number for the selected cell.
tsRow
(Default value)
<Result> will correspond to the number of the selected row.
tsCellLine<Result> will correspond to the row number for the selected cell.
If this parameter is not specified, the function will return the number of the selected line.
WEBDEV - Server codeJavaPHPAjax This parameter is not available.
Type of information to return:
tsColumn<Result> will correspond to the number of the selected column.
tsCellColumn<Result> will correspond to the column number for the selected cell.
tsRow
(Default value)
<Result> will correspond to the number of the selected row.
tsCellLine<Result> will correspond to the row number for the selected cell.
If this parameter is not specified, the function will return the number of the selected line.
WEBDEV - Server codeJavaPHPAjax This parameter is not available.
AndroidiPhone/iPadJava This parameter is not available. The function will return the number of the selected row.
Remarks

Use conditions

TableSelect can be used on:
  • a browsing or memory control.
  • a single-selection or multiselection control. For multiselection Table controls, you must use TableSelect in a loop to get all the selected rows.
    WEBDEV - Server codePHP Reminder: Multiselection controls are available in Ajax only WEBDEV - Server codePHP Reminder: Multiselection is not available for Table controls in classic mode.
WEBDEV - Server codePHP This function is available for Table controls in Ajax mode, Table controls in classic mode and TreeView Table controls.
WEBDEV - Browser code This function is available for Table controls in browser mode only.
WEBDEV - Browser codeAndroidiPhone/iPad The TreeView Table control is not available.

Equivalence TableSelect

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

Value of selected element

To retrieve the value of selected element, the syntax is:
Subscript is int
Subscript = TableSelect(<Table control>)
<Element value> = <Table control> [Subscript]
or
<Element value> = <Table control> [<Table control>]
Versions 16 and later
WINDEVWindows MobileJava

Selection at cell level

For a control that is using a "multiple selection" mode for the cells, ..Selected is used to find out whether a cell is selected or to select a cell by programming.
New in version 16
WINDEVWindows MobileJava

Selection at cell level

For a control that is using a "multiple selection" mode for the cells, ..Selected is used to find out whether a cell is selected or to select a cell by programming.
WINDEVWindows MobileJava

Selection at cell level

For a control that is using a "multiple selection" mode for the cells, ..Selected is used to find out whether a cell is selected or to select a cell by programming.
Component : wd240obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
//Capturar valores de uma Table com Mutiplas Seleções
//Capturar valores de uma Table com Mutiplas Seleções
Total is int = TableSelectCount(TableGrid_Clientes)
x is int
Loop(total)
x++
trace(TableGrid_Clientes[TableSelect(TableGrid_Clientes, x)])
trace(TableGrid_Clientes[TableSelect(TableGrid_Clientes, x)].COL_Codigo)
trace(TableGrid_Clientes[TableSelect(TableGrid_Clientes, x)].COL_Nome)
end
BOLLER
20 May 2019
exemplo selecionar linhas tabela
https://youtu.be/eEu-Iwza-2s

http://windevdesenvolvimento.blogspot.com/2018/06/dicas-1775-publica-windev-23-tabela-80.html

https://groups.google.com/d/forum/amarildowindev

// comandos abaixo


n_QUANTAS_LINHAS_SELECIONADAS is int=TableSelectCount(TABLE_Cliente)

FOR I=1 TO n_QUANTAS_LINHAS_SELECIONADAS
// VOU AGORA LER O CADASTRO DE CLIENTE
HReadSeekFirst(cliente,clienteid,TABLE_Cliente.COL_Clienteid[TableSelect(TABLE_Cliente,I)])
IF HFound(cliente) THEN
// ENTAO AQUI VAMOS FAZER O PROCESSAMENTO
// EXEMPLO
// APENAS MOSTRAR O NOME
Info(cliente.nome)
END
END
De matos
11 Jun. 2018
Let's do the registry change.
//Aula 1153 WinDev Curso ErpAmarildo 11 - Tabela Codigo de Alteração

//Nessa aula de hoje
//vamos fazer a alteração do registro.

//En esta clase de hoy
//Vamos a cambiar el registro.

//In this class today
//Let's do the registry change.

IF TableSelect(TABLE_QRY_RELACAO_EMPRESAS)=-1 THEN RETURN
_indice is int=TableSelect(TABLE_QRY_RELACAO_EMPRESAS)
HReadSeekFirst(empresa,empresaID,TABLE_QRY_RELACAO_EMPRESAS.COL_EmpresaID)
IF HFound(empresa) THEN
Open(WIN_Form_empresa)
END
TableDisplay(TABLE_QRY_RELACAO_EMPRESAS,taReExecuteQuery)
TableSelectPlus(TABLE_QRY_RELACAO_EMPRESAS,_indice)

De matos
18 May 2017
Tabela - Selecionar varias linhas e ler

IF YesNo("Tem Certeza que deseja dizer que já levou essa nota") THEN
n_quantas_linhas is int=TableSelectCount(TABLE_QRY_ler_manifestacao_mdfe)
FOR i=1 TO n_quantas_linhas

n_id_man is int=TABLE_QRY_ler_manifestacao_mdfe.COL_01_Id_manifestacao_notas[TableSelect(TABLE_QRY_ler_manifestacao_mdfe,i)]

Trace("quantas_linhas:"+n_quantas_linhas+CR+"i:"+i+CR+"n_id_man:"+n_id_man)
HReadSeekFirst(nota_fiscal_manifestacao_mdfe,id_manifestacao_notas,n_id_man)
IF HFound(nota_fiscal_manifestacao_mdfe) THEN
Trace(nota_fiscal_manifestacao_mdfe.id_manifestacao_notas)
nota_fiscal_manifestacao_mdfe.xml_baixado=True
nota_fiscal_manifestacao_mdfe.nota_transferido=True
HModify(nota_fiscal_manifestacao_mdfe)
END
END
atualiza_levar_notas()
TraceEnd()

END

//Blog com video e exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/04/curso-windev-tabela-022-tableselect.html
De matos AMARILDO
20 Apr. 2016