API1 to API2 conversion experience

It depends on how you feel about things. Personally, I hate having warnings kicking around. I suppose I could turn them off as this is “only” API1 → API2 warnings, but we know that the future focus is API2.

Going through my app did show up a number of minor improvements to make, and I scratched my head a couple of times wondering why did I do it that way?

I’m older than you, by the way.

Hey Beatrix!
I’m a bit confused by your response. API1 has autocomplete. Granted, the API1 docs are often incomplete and not very helpful, but are the docs that much better for API2?

No, there is no autocomplete for API1.

2 Likes

Now, I’m really confused. OK, then what is this (see the lbx … in the image)???

It’ll do it for one of your methods, but not for an API1 control.

Autocomplete acts differently depending on the Super of App. If you haven’t changed your App object to DesktopApplication, you should see the old autocomplete entries.

OK, Tim … still confused …then how come this native API1 textfield control (see txfLineupConfig in the image) autocompletes?

What version of Xojo are you using?

Just out of curiosity, Tim, how so? Are you referring to Supers created by the user? Could you give me an example off what you’re saying?

2016 r1.1

I didn’t think that was possible! :rofl: :joy: :rofl:

That is vor API[1], what version for API2 ?

Talking about how old… there are many olsters here…

The API 2 desktop controls don’t appear until 2021r3. Anything earlier than that only knows about API1.

The API2 string methods arrived in 2019r2 (IIRC).

If I understand your question right, I don’t have a version that has API2. My question was why (with my scenario in mind) would I want to switch to API2.

You would want to switch to API2 if and only if there is a feature in the new release that you cannot replicate in API 1 and is a deal breaker if you don’t implement it. Or an OS change that breaks your application. (I call these “compelling reasons”)

I have a number of API1 web applications. New ones are API2, but the older ones, which are happily productive, will remain API1 until there is a compelling reason to make a change. The same reasoning would apply to desktop applications as well.

1 Like

Thanks, Louis … that pretty much sums up what I was thinking. I just wasn’t sure, based on all the talk here on the forum, if I was missing something. From the looks of it though, it doesn’t appear that I am … and since this is a Windows environment, I don’t have to worry too much about OS changes since they only occur every 6 - 7 years with Microsoft.

Found another “difference” between API1 and API2. Consider the following line:

Dim sss As String = theList.CellValueAt (theList.SelectedRowIndex, 0)

In API1, if there is no selected row the SelectedRowIndex is -1 and the resulting string value is empty. But when converted to API2,

Dim sss As String = theList.CellTextAt (theList.SelectedRowIndex, 0)

and there is no line selected, it yields an OutOfBounds error.

Obviously, there should be a check in the code for DesktopListbox.NoSelection but if you are a lazy programmer (like me) you’re likely to get hit with this one when/if you convert apps to API2.

1 Like