Anyone spend the time converting a desktop app to AP2

You can see in this thread here:

I went ahead and took one more application and did the conversion. Going to Desktop API took 2 and half hours having done it several times before then I knew all the issues I would hit in it which speed-ed it up.

First thing you need to realize is there is no such thing as API2 is one thing. Since the API2 vs not API2 is not Boolean on or off. The story has more sides than that.

So for conversion what you have to do in one go is to go to Desktop API in one round (which is the part I did above in 2 and half hours).

You typically do that by:

  • Let Xojo do the ininital conversion.
  • If you have Plugin controls then go to all your Windows and Dialogs and make sure you update all the plugin controls from xxxx to Desktopxxxx.
  • Manually update events also on plugin controls.
  • If you had classes that inherit from controls then Xojo auto convert also wont help you much on those you will need to do manual fixes there on Events.

Once you have done all the above that you know of then try to build and follow the errors that come up.

Once you have the App building then you have done Desktop API conversion. Note this is not full API 2 conversion.

Full API conversion you can do over time if wanting, as in that does not have to happen all at once like with the Desktop API.

Since I was testing how fast or slow it was to do conversion then I went ahead and did the full API2 all at once also. (doing the full conversion took me 3 nights)

To proceed to do full API2 conversion:

  • Turn on all warnings
  • Do Analyze project (this gave me over 4000 warnings if I remember correctly)

Now from past experience then I knew already that some changes are in such way that you can easily brake your app and create very hard to find bugs. So I had strategy for this this time. Which was to first focus on Obvious things.

Dim you can take care of by doing Search and replace "Dim " "var " (include the space there)
UBound to LastIndex (you have to do it manually no search and replace)
Other such obvious things with no impact on functionality…focus on one thing only if your on UBound then only do Ubound, then its just mechanic work and no risk or low risk of getting confused and creating issues in the code.

Leave more dangerous things like Mid and Instr until very last, those two are particularly dangerous because of the change of 1 based index to zero based.

Weed down all the warnings, also unused variables, put pragmas on unused parameters. Since all those warnings will be noise that get in your way to tackle the actual API2 warnings.

Once its time to do the more dangerous ones then Do tests, in separate App Test like “Mid worked like this…” “what do I have to do to make it work in the new system in same way” once you know that then apply that knowledge in all places (again only doing one single thing at a time not Mid and Instr at same time since thats sure way to get confused and creating huge issues).

So thats the journey I did with 2 and half hours to Desktop API + 3 nights to Full API 2.

Since then there have been few issues with the Application which I don’t remember the details of but it was related to creating Binary files I think. (something there that hit me in the conversion)

8 Likes