Using old framework in the time of the new framework

I have been using Xojo/RB since 2002 or so, but have been away from it for a while more recently. I see there is a whole new framework with new commands that seem to replace the old ones. For example, I was using things like str command to convert numbers to string, and now it seems there is “toText”. My apps still compile, but is this a honeymoon period before those old commands are made obsolete? And is there a runtime hit with using those older commands?

Don’t worry about it… that “New” framework is going to be deprecated in favor of a “New New” framework soon … And the “old” framework will be around for many years yet to come… so personally… I’d go with the “old” framework, as in my opinion, that will make any future transistion easier in the long run.

Stick with the “old” commands as the “new” stuff is being deprecated. But neither is going away.

Lookup API 2.0 for more information.

But do not hold your breath 'till this new new stuff appears. :wink:

But I recall seeing some threads that seem to document that you get into trouble if you us string, and that one should use text. Although I’ve gotten into trouble using text, too.

Also: Eventually I figure out that a text is a series of unicode code points, with an encoding attached to it. When converting the relevant portions of my app from PHP to Xojo, I discover that if I have 100,000 lines of text each of which is 70 or so ASCII chars long, then building a single text out of them by concatenating them together is extremely slow. Eventually I tried treating all text in this situation as arrays of characters and just using join. That was a lot faster.

Perhaps in the new framework text can already be such an array.

Yes but where? I try to search this forum for “API 2.0” and get told off because each token is less than 4 chars long.

Here is some information:
https://blog.xojo.com/2018/04/25/xdc-2018-keynote-recap-draft/

There is an API 2.0 section

use Google instead “Xojo API 2.0” returns quite a number of links, including some not here on the forum

If you’re converting PHP to Xojo then use String as PHP strings are the same as Xojo strings: a bucket of bytes. Xojo should have never replaced String for Text, but rather just added Text.

So use “toText” for present coding, leave “str” for older code, and expect some third system to develop?

If you have a choice, use String. Text is being deprecated too.

What will replace it? And why?

API 2.0 is replacing the “New Framework” soon…

Hopefully “2.0” will simply encapsulate new “stuff” into the existing object types without disrupting current functions.

So I think the common train of thought (at least the one I’m a passenger on) says that any future transition to API 2.0 will be much easier (or even transparent) if you stay with the “old” framework…

Right. The way I understand it, code in the classic framework will be updated and made compatible with iOS. Where needed, new functions and methods will be added to standardize calls across classes with the functions/methods they replace eventually being deprecated and removed from auto-complete. String will be the type going forward since it is so heavily used in the classic framework and controls, but something (I know now what) will be added or changed to make encodings easier to deal with.

Again, this is just my understanding.

Old timers like me remember when strings were indeed “buckets of bytes” and when Chr(n) meant the character at position n in the font.

Then strings became UTF-8, and all the sudden Chr() meant the unicode value of the character.

It would make sense that string acquired all the nice stuff in Text.