PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Limitations
  • Browsing List Box control
  • Last element
  • Various
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 elements found in a List Box (or ListView) control or in a Combo Box control.
Note: ListCount can be used on:
  • the browsing or memory List Box controls,
  • the single-selection or multi-selection List Box controls.
Versions 15 and later
Android This function is now available for the Android applications.
New in version 15
Android This function is now available for the Android applications.
Android This function is now available for the Android applications.
Versions 16 and later
WINDEVLinux This function is now available for the WINDEV applications in Linux.
New in version 16
WINDEVLinux This function is now available for the WINDEV applications in Linux.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 18 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Universal Windows 10 App This function is now available in Windows Store apps mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
// Number of elements found in the "LIST_CustomerList" control
ResNumberElements = ListCount(LIST_CustomerList)
Syntax
<Result> = ListCount(<List Box Control>)
<Result>: Integer
Number of elements (rows) found in the specified control.
<List Box Control>: Control name
Name of List Box or Combo Box control to use. If this parameter corresponds to an empty string (""), the control to which the current process belongs will be used.
WEBDEV - Browser code The name of List Box (or Combo Box) control to use must necessarily be specified.
Remarks

Limitations

If the specified List Box (or Combo Box) control is linked to a file that contains more than 2,147,483,647 records, the returned value is truncated to this value.
WINDEVWEBDEV - Server codeReports and QueriesAndroidiPhone/iPadWindows MobileUniversal Windows 10 AppJavaAjaxUser code (UMC)

Browsing List Box control

For a browsing List Box control, ListCount returns:
  • the total number of records found in the linked file if no filter was defined.
  • the number of records matching the filter if a filter was defined.
  • the number of records found in the query linked to the control.
The end of initialization code of control is run once the total is calculated.

Caution: The time for calculating the number of records can be quite long

Last element

To position on the last element of List Box control, use the following syntax:
ListSelectPlus(<List Box Control>, <List Box Control>..Occurrence)
or
<List Box Control> = <List Box Control>..Occurrence
or
<List Box Control> = ListCount(<List Box Control>)

Various

  • To find out the number of rows in a Table control, use TableCount.
  • ListCount can be used on a "Combo box" table column.
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
Exemplo Listbox - quantos clientes tem
// Elimina dados do Listbox
ListDeleteAll(LISTE_programa)
// Ler a tabela de clientes e preenche ListBox
FOR EACH cliente
ListAdd(LISTE_programa,cliente.nome)
END
//Verifica quantos tem no ListBox
n_quantos is int = ListCount(LISTE_programa)
//Mostrando mensagem
Info("Tem "+n_quantos+" clientes")

//Blog com Video e exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/04/curso-windev-listbox-003-listcount.html
De matos AMARILDO
Apr. 17 2016