API 2 conevrsion

XOJO 2022r1 - Windows 10
What is the replacement for ‘If eList.Selected(i)’ in the code below ?
eList is a DesktopListBox
Sorry but I can’t find it anywhere in the help documentation.

For i = 0 To eList.RowCount
  If eList.Selected(i) Then
    Line = eList.CellTextAt(i, 0) + "   " + eList.CellTextAt(i, 1) + "   " + eList.CellTextAt(i, 2)
    rows = rows + line + EndofLine
  End If
Next

Regards
Etienne

RowSelectedAt(i)
https://documentation.xojo.com/api/user_interface/desktop/desktoplistbox.html#desktoplistbox-rowselectedat

For i = 0 To eList.RowCount
  If eList.RowSelectedAt(i) Then
    Line = eList.CellTextAt(i, 0) + "   " + eList.CellTextAt(i, 1) + "   " + eList.CellTextAt(i, 2)
    rows = rows + line + EndofLine
  End If
Next

As a general principal anything that takes an index parameter will end in “At”.

Thanks
Oeps, not seen that.
But in XOJO 2021r1.1 ‘Listbox.Selected(i)’ was in the properties.
In XOJO 2022r1 it ‘ListBox.RowSelectedAt(i)’ is placed in the ‘Methods’.

Regards

That’s odd. Properties cannot have parameters. I suppose it could have been an array.

One tip, if you open the docs in a web browser you can search the page for text such as “Selected”:

http://documentation.xojo.com

Selected doesn’t show in the Debugger ListBox property list either.

I would say it was a computed property before. What‘s technically also a method.

Computed properties do not allow you do define parameters either.

:man_facepalming: Of course, Ian, you‘re right.

1 Like