Type "Iterable" has no member named "LastRowIndex"

FInally dipping my toes into the API 2.0 morass. Biggest issue / PITA so far has been the inexplicable deprecation of Ubound.

I have a class that has a one-dimensional array property

Rows() as AnotherClass

I need to get the upper bound (uh… UBOUND!) of the array, so I hold my nose and pretend that a one-dimensional array has “rows”, and do

x = Rows.LastRowIndex

which results in a compiler error "Type “Iterable” has no member named “LastRowIndex”

What to do?

what type is X ? that error is odd

where is this code ? that might be relevant and maybe its getting ROWS confused with something else ?

Yes, arrays do have a “Count” method in addition to the “LastRowIndex” method, however

"Type “Iterable” has no member named “Count”

:frowning:

It’s in a subclass of ListBox, but as far as I can see, ListBox has no property or method or event named “Rows”.

I’m thinking the location of this code factors into this as well as “Rows” is a listbox method that returns an iterable set and that might just be confusing things

Hence “where is this code” ?

It has a method named rows and I bet if you rename your array the issue goes away
http://documentation.xojo.com/api/deprecated/listbox.html#listbox-rows

[quote=483743:@Norman Palardy]It has a method named rows and I bet if you rename your array the issue goes away
http://documentation.xojo.com/api/deprecated/listbox.html#listbox-rows[/quote]
You may be right that renaming my array might solve the problem, but the documentation shows no method called “Rows”

So I see the local set is missing that entry :frowning:

Ah yes, I see it now in the web docs, thanks

<https://xojo.com/issue/59762>

creeping up on 500

Must… error… faster :wink: