Why "No member"?

Type “DesktopListBox” has no member named “CellValueAt”
dtt=ToDoWin.ImpNurg.CellValueAt(i, 2)

Type mismatch error. Expected String, but got Int32
dtt=ToDoWin.ImpNurg.CellValueAt(i, 2)

I get these two errors in a for … next loop where i=0 to LastRowIndex
but dtt is declared as String and ToDoWin.ImpNurg is the reference to a 3 columns ListBox in the ToDoWin window, the method itself is in App.
So, why no member?

Thank you

Hi Armando
Try CellText or CellTextAt.

CellValueAt should be correct. Is the listbox public or private?

From the DesktopListBox doc:

Notes

Items in a single-column DesktopListBox can be accessed using the CellValueAt method as the column parameter defaults to 0. The following example gets the value in the first row of a DesktopListBox:

Var lastName As String
lastName = ListBox1.CellValueAt(0)

CellValueAt is Listbox CellTextAt is DesktopListBox (if the docs are correct)

https://documentation.xojo.com/api/deprecated/listbox.html#listbox-cellvalueat

http://documentation.xojo.com/api/user_interface/desktop/desktoplistbox.html.CellTextAt

Even there ist much explaination about CellValueAt in the docs for DesktopListbox, this method is not listed as an available method

Thank you. I found it out.
Strange that CellValue is still listed, though

CellValueAt is listed with ONE parameter, Armando used TWO…

Why one parameter? From Language reference:
ListBox.CellValueAt (RowNumber as Integer, ColumnNumber as Integer) As String

Hmm, no…

Public, I fixed it with CellTextAt. Although even CellValueAt should have worked

No it shouldn’t. The documentation is wrong. And I sent a message to docs@xojo.com requesting that the doc be fixed.

1 Like

http://documentation.xojo.com/api/user_interface/desktop/desktoplistbox.html

Search the Note or read it here (some entries before). I copy/pasted it. Or maybe I am in my bed dreaming ?

No it isn’t: