DesktopListbox - Getting Listbox Contents Behavior Change in API 2.0?

Prior to API 2.0, one used to be able to obtain the entire contents of a Listbox with a simple call such as:

Var ListboxContents as String = theListbox.Cell(-1,-1)

In API 2.0 - The replacement method CellTextAt returns an OutofBounds Exception when calling CellTextAt(-1,-1).

Is there another replacement keyword I’m missing for API 2.0 or has the behavior of the listbox changed to no longer honor such code?

Looping thru each row would be very inefficient/time-costly for my current use case…

Maybe try: https://documentation.xojo.com/api/user_interface/desktop/desktoplistbox.html.Content

Life Saver! Thanks Scott! I figured Xojo had a new keyword somewhere :slight_smile: Over the last 20 years - we’ve had to adapt to changes in the language a good 4-5 times with each new API. We’re supposedly on API 2.0 - but I’m pretty certain it’s like revision 5 or 6 by now :yo-yo:

1 Like

By my count, API 2.3:

API 2.0 - Initial launch
API 2.1 - Array.AddRow -> Array.Add
API 2.2 - JSONItem HasName -> HasKey (and other tweaks for new OS level API)
API 2.3 - Desktop* Prefixes
1 Like