Mix of classic and new framework?

In a project written with he old framework, I need both 1.1 support and https://.
So I changed the old HttpSocket and HttpSecureSocket classes to Xojo.Net.HTTPSocket. Converted the Text to strings and new Memoryblocks to classic Memoryblocks etc.

So far all was easy and those parts seems to be working but now I get Nil exception errors in totally unrelated places.
Is this normal or am I missing something?

Hard to know based on what little you’ve said
So am I missing something?
The answer seems to be Yes but I cant tell you what

Hi Marco and Norman,

I also converted a project made with the old framework (I am still working on it) to the new one. For almost 3 weeks I had a lot of headaches. Nevertheless I was very persistant and finally succeeded.

My most problems experienced was with the textfiles I had to load and save. My folderitems gave me the greatest problems. they are all properties. So I had them declared as :

name : f_Project
Type : FolderItem

When using the new framework I had to declare them as :
name : f_Project
Type : Xojo.IO.FolderItem

At the top of the sections which use the new framework I place :

Using Xojo.Core
Using Xojo.IO

In all places I put “Using Xojo.IO” I needed to use the new declaration “Xojo.IO.FolderItem”.

I do not know If I did the correct thing but it worked.

It is very easy to make mistakes when converting the old to the new framework. Many times I thought it was a bug, where finally I found out I misinterpreted the documentation.

I spend many hours watching Paul Lefebvre his webinars and read the documentation. When learning the new framework, I found the webinars about the “Framework” and “Text and Encodings” the most valuable one. I watched the latter one 4 times.

One thing definatelly lacking in the documentation is examples. The pieces of code in the documentation is not enough. But finally when all the bits and pieces came together I managed.

I like to ask what the best way is to learn the new framework and the best way to convert the old to the new framework.

At first I did not understand the reason why something which worked (strings) change into text. However for me the correct encoding (UTF-16) is very important and I cannot afford any change in between. So now mastering the “text” type, I benefit greatly from it. I read text (UTF-16), make a translation and then save it back as text (UTF-16) to a textfile. When checking with TopStyle 5, encoding is UTF-16.

In this way, Xojo let me do a translation which otherwise takes me days do in less than 4 hours. Another benefit for me, I can use the application as I want to use it because I developed it. Changes and adaptions are made within hours.

I create more of this kind of small applications and in my opinion it is here where Xojo shines bright. Xojo is very usefull in a wide spread of fields. When you can imagine it, you can create it with Xojo.

Wish you both a very nice day.

Chris

There is no single way to proceed to transition towards new framework, and basically what for you works for you. I love that quote from Albert Einstein posted on w3scools.com : “Make it as simple as possible, but not simpler”.

For older code, I found it rather easy to wrap new framework commands in methods that use the same syntax as classic Xojo.

For new code, I would try to use only the new framework, where possible, or when the new framework does not have a feature, favor the dot notation. which is a landmark of the new framework, so when the feature becomes available, chances are it will be syntactically close.

The issue from my original question is solved. Nothing to do with the new framework, totally my mistake. Sorry for that.

But while on topic, there a few things stopping me from converting old Apps to the new framework. Mainly the way on how I search for documentation now.
I normally type in google what I need and I get a nice mixture of forum posts and links to the documentation. However, I’m not sure how I’m supposed to search within the new framework only.
Also, (as mentioned above) there are not many examples in the new fw docs. At least not as in the docs of the old fw.
I also noticed that if I have an existing event handler (for let’s say HTTPSocket) and I change the super to Xojo.Net.HttpSocket, the parameters for the event aren’t updated. I need to delete and add the event.

If I can find a better way to search the docs and if there is some kind of switch that forces me to use the new fw (so starts throwing errors when using anything from the old fw) I will start the next project using the new fw.