PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Use conditions
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 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).
  • Versions 16 and later
    the number of selected cells 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 selected cells if the controls allows the selection mode by cell. This option can be configured in the "GUI" tab of control description.
    the number of selected cells 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 number of selected columns 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 selected columns if the control allows the selection mode by column. This option can be configured in the "GUI" tab of control description.
    the number of selected columns 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
Linux This function is now available for the WINDEV applications in Linux.
New in version 16
Linux This function is now available for the WINDEV applications in Linux.
Linux This function is now available for the WINDEV applications in Linux.
Versions 18 and later
WEBDEV - Server codePHP This function can now be used to handle the TreeView Table control in the WEBDEV and PHP sites.
New in version 18
WEBDEV - Server codePHP This function can now be used to handle the TreeView Table control in the WEBDEV and PHP sites.
WEBDEV - Server codePHP This function can now be used to handle the TreeView Table control in the WEBDEV and PHP sites.
Versions 19 and later
WEBDEV - Browser code This function is now available in Browser code.
New in version 19
WEBDEV - Browser code This function is now available in Browser code.
WEBDEV - Browser code This function is now available in Browser code.
Versions 20 and later
Android This function is now available for the Android applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 20
Android This function is now available for the Android applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Android This function is now available for the Android applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Example
// Traces the content of 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 the multi-selection controls.
<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 process belongs will be 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
Versions 16 and later
Type of information to return:
tsColumn<Result> will correspond to the number of selected columns.
tsCell<Result> will correspond to the number of selected cells.
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.
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 selected columns.
tsCell<Result> will correspond to the number of selected cells.
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.
WEBDEV - Server codeJavaPHPAjax This parameter is not available.
Type of information to return:
tsColumn<Result> will correspond to the number of selected columns.
tsCell<Result> will correspond to the number of selected cells.
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.
WEBDEV - Server codeJavaPHPAjax This parameter is not available.
AndroidiPhone/iPadJava This parameter is not available.
Remarks

Use conditions

TableSelectCount can be used on:
  • a browsing or memory control.
  • a single-selection or multi-selection control.
    WEBDEV - Server codePHP Reminder: The multi-selection controls are available in Ajax only. WEBDEV - Server codePHP Reminder: The multi-selection is not available for the Classic Table controls.
WEBDEV - Server codePHP This function is available for the Ajax Table controls, the Classic Table controls and the TreeView Table controls.
WEBDEV - Browser code This function is available for the browser Table controls only.
WEBDEV - Browser codeAndroidiPhone/iPad The TreeView Table control is not available.
Components
WINDEVReports and Queries wd230obj.dll
WEBDEV - Server code wd230page.dll
Windows Mobile wp230obj.dll
WEBDEV - Browser code WDJS.DLL
Java wd230java.jar
Linux wd230obj.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Example
PROCEDURE Filhos(ID, MarcaDesmarca, Filho01, Filho02, Filho03)

//info(ID,MarcaDesmarca)

x is int = 0

registros is int = TableCount(TABLE_Select_Preferencias)

IF (ID > 0 AND Filho01 > 0) OR (ID > 0 AND Filho02 > 0) OR (ID > 0 AND Filho03 > 0) THEN

FOR i = 1 _TO_ registros

x+=1

IF TABLE_Select_Preferencias[x].COL_ID = Filho01 OR TABLE_Select_Preferencias[x].COL_ID = Filho02 OR TABLE_Select_Preferencias[x].COL_ID = Filho03 THEN

//Mudar a cor
IF MarcaDesmarca = 1
TABLE_Select_Preferencias[x].COL_X = True
TABLE_Select_Preferencias[x].COL_X..Color = DarkGreen
TABLE_Select_Preferencias[x].COL_Preferencia..Color = DarkGreen
TABLE_Select_Preferencias[x].COL_X..BrushColor = LightGreen
TABLE_Select_Preferencias[x].COL_Preferencia..BrushColor = LightGreen
ELSE IF MarcaDesmarca = 0
TABLE_Select_Preferencias[x].COL_X = False
TABLE_Select_Preferencias[x].COL_X..Color = Black
TABLE_Select_Preferencias[x].COL_Preferencia..Color = Black
TABLE_Select_Preferencias[x].COL_X..BrushColor = White
TABLE_Select_Preferencias[x].COL_Preferencia..BrushColor = White
END


END

END

END

adrianoboller
Nov. 26 2015