Gets number of items in listbox listboxName.
For multiple-column ListBoxes, the number of rows. ListCount is 1-based.
Parameters:
Name |
Type |
Value |
Description |
listboxName |
String |
name |
ScreenFieldName of the listbox to set the number of columns. Ctrl+Click onto a listbox to retrieve its listboxName (= ScreenFieldName) |
Returns:
Type |
Value |
Description |
Integer |
0 - n |
Returns the number of rows in the list. ListCount is 1-based |
|
-2 |
An error occurred. The number of rows could not be evaluated. |
Available in:
WindowMain |
WindowLink |
YES |
YES |
Used in:
XojoScript Name |
GUID |
Calculate total participation fee for current attendee |
F0F802CC-D151-4F59-A749-1E232527D0C2 |
Load seminar prices to registration |
1E3DB33D-DC46-46BB-8483-C15DBDF3A423 |
Calculate seminar participation fee |
2F6CFC74-44AB-4956-A760-BBD5E57595E8 |
Edit Registration |
89F9973D-C3A4-4466-BAE7-8AE85115AE09 |
Create Seminar Invoice in Word |
D2036EFA-D283-481A-9A93-D00547680749 |
Calculate participation fee for seminar attendee |
032B50D3-D463-453E-9370-9AF7C34DA1D5 |
Hint: You can find references to XojoScripts which make use of this function by sending the following SQL statement to the database:
Select id,GUID, ScriptName,ScriptCode from im_scripts where ScriptCode Like '%ListCount%'
Example XojoScript:
// WindowLink.imSB_lnk_p02_Recalc, Recalc Total Payments
CalcTotal
Sub CalcTotal()
Dim lbHandle As Integer = ListGetHandle("imLB_lnk_p01_PaymentList")
Dim numRows As Integer = ListCount("imLB_lnk_p01_PaymentList")
Dim totalPaid As Double = 0.0
If numRows > 0 Then
For i As Integer = 0 to numRows-1
totalPaid = totalPaid + Val(ListGetCell(lbHandle,i,2))
Next
End IF
SetText("imTF_lnk_p01_TotalPaid",Format(totalPaid,"-#####0.00"))
End Sub