Gets contents of cell at row, column in listbox listboxHandle.
For multiple-column ListBoxes, the number of rows. ListCount is 1-based.
Parameters:
Name |
Type |
Value |
Description |
listboxHandle |
Integer |
0 - n |
You can retrieve the a handle to a listbox with the ListGetHandle function. Hint: If we loop through all rows of a listbox to operate on the contents of cells, we prefer this version of ListGetCell which makes use of a handle (pointer) to a listbox. When we use the version with the listbox name as a parameter, the listbox has to be searched in every single iteration of the loop. This can slow down the operation. For an example on how to work with ListGetHandle and ListGetCell, see example below. |
row |
Integer |
0 - n |
Index of listbox row to be retrieved. row and column are zero-based. The top-left cell is 0,0. Passing -1 as either the row or coumn number means all rows or all columns, respectively |
column |
Integer |
0 - n |
Index of listbox column to be retrieved. row and column are zero-based. The top-left cell is 0,0. Passing -1 as either the row or coumn number means all rows or all columns, respectively |
Returns:
Type |
Value |
Description |
String |
text |
Returns the contents of the cell at row, column as text. |
String |
ERROR |
An error occurred. The contents of the cell at row, column could not be retrieved. |
String |
"1" or "0" |
If the CellType is CHECKBOX, then either 0 or 1 are returned. 1 = CHECKED 2 = UNCHECKED |
Available in:
WindowMain |
WindowLink |
YES |
YES |
Used in:
XojoScript Name |
GUID |
Calculate total participation fee for current attendee |
F0F802CC-D151-4F59-A749-1E232527D0C2 |
Calculate seminar participation fee |
2F6CFC74-44AB-4956-A760-BBD5E57595E8 |
Create Seminar Invoice in Word |
D2036EFA-D283-481A-9A93-D00547680749 |
Calculate participation fee for seminar attendee |
032B50D3-D463-453E-9370-9AF7C34DA1D5 |
Add a Payment for Event participation |
877AA389-2167-4A95-904E-95C6329A2BFD |
Delete seminar participation payment |
FBE87F41-596E-4C04-BB74-1B9A8FA21FEF |
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 '%ListGetCell%'
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(lbHandle)
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