PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Use conditions
  • Equivalence between TableCount and ..Size
  • Case of Ajax Table controls
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 columns found in a Table or TreeView Table control.
  • the number of rows found in a Table or TreeView Table control.
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 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 the Browser Table controls.
New in version 19
WEBDEV - Browser code This function is now available in Browser code for the Browser Table controls.
WEBDEV - Browser code This function is now available in Browser code for the Browser Table controls.
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
// Number of rows found in the "TABLE_Product" control
ResNumberRow = TableCount(TABLE_Product)
Syntax
<Result> = TableCount(<Table Control> [, <Row/Column>])
<Result>: Integer
Number of rows or columns found in the specified control.
<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.
<Row/Column>: Integer constant (optional)
Used to specify the type of returned result:
  • the toShown, toTotal and toVisible constants contain a number of rows.
  • the toColumn constant contains the number of columns in the control.
Browsing Table or TreeView Table controlMemory Table or TreeView Table control
toShown
WEBDEV - Server code Default constant for a browsing Table or TreeView Table control.
WEBDEV - Browser code Constant not available.
Number of non-empty rows visible in the control.
WEBDEV - Server codePHP This constant must not be used for the Table controls in AJAX mode.
Number of non-empty rows in the visible part of the control.
Note: The hidden rows (..Visible) are counted.
toColumnNumber of columns found in the control.Number of columns found in the control.
toTotal
(Default value)
WEBDEV - Server codePHP Default constant for a memory Table control.
  • Total number of records ("Proportional scrollbar" is checked):
    • of the linked file (if there is no filter).
    • filtered of the linked file (if there is a filter).
    • in the query (if the control is linked to a query).
  • Number of visible records if the control includes a scrollbar with an ongoing movement ("Proportional scrollbar" unchecked)
Caution: The "end of initialization" code is run once the total is calculated.
WEBDEV - Server code Total number of records:
  • in the linked data file (if there is no filter).
  • filtered of the linked file (if there is a filter).
  • in the query (if the control is linked to a query).
WEBDEV - Server code This calculation may take quite a long time if the control is linked to a huge data file.
Number of rows in memory (rows added by the user or rows added by TableAdd, TableAddLine, TableInsert and TableInsertLine).
Note: The hidden rows (..Visible) are counted.
toVisible
WEBDEV - Browser code Constant not available.
Number of visible rows (including the empty rows or the rows that are partially displayed). Corresponds to the maximum number of rows that can be displayed in the control.
WEBDEV - Server codePHP This constant must not be used for the Table controls in AJAX mode.
Number of visible rows (including the empty rows or the rows that are partially displayed). Corresponds to the maximum number of rows that can be displayed in the control.
Note: The hidden rows (..Visible) are counted.
Remarks

Use conditions

TableCount 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.
WINDEVWEBDEV - Server codeWindows MobileJavaPHPAjaxUser code (UMC)

Equivalence between TableCount and ..Size

TableCount and ..Size are equivalent:
ResNbColumn = TableCount(<Table Name>, toColumn)

ResNbColumn = <Table Name>..Size
WEBDEV - Server codePHPAjax

Case of Ajax Table controls

The value returned by TableCount always corresponds to the number of rows available on the server (for the browsing Table controls). This value does not necessarily correspond to the data viewed in the Table control in the browser. Indeed, the changes made by the user on an AJAX Table control are performed on the browser only.
Example:
TableCount(TABLE_Ajax_Table, toShown)
// Returns 10 instead of 9
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
Tabela , Saber quantas e nome das colunas
n_numero_colunas is int=TableCount(TABLE_pedido,toColonne)
FOR x=1 TO n_numero_colunas
s_nome_coluna is string=TableEnumColumn(TABLE_pedido,x)
Trace("Numero Coluna:"+x+CR+"Nome coluna:"+s_nome_coluna)
END

//Blog com Video e exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/04/curso-windev-tabela-021-saber-quantas-e.html
De matos AMARILDO
Apr. 19 2016