I recently had to do some edits on an old Real Basic program, and when I loaded it into Xojo I got a lot of deprecated item warnings. Most of them are benign and deal with StaticText elements that should now be Labels, but I was wondering if there was an easy way to do a mass migration of the element from StaticText to Label (or other deprecated items to the new replacement). Creating new Label elements one at a time seems a bit tedious, especially since some have special formatting (font attributes, alignment, etc). I’m wondering if there’s a way to do something easy like a right-click followed by a “change this in place from StaticText to Label” functionality. Selecting the items in the initial warning window and checking “Resolve” doesn’t seem to do much other than ignoring the item the next time the project is loaded.
Probably wishful thinking, but since there is usually a replacement for deprecated items, it would seem that there should be an easy way top update older source code. Am I missing something?
I havent been in this situation lately but in my experience, Resolve does indees resolve these issues (like turning StaticText elements into Labels).
Resolve usually fixes 90 to 100% of the issues… as long as you don’t have code that passes them as datatypes in Method calls
And make sure the items are CHECKED otherwise resolve skips them
It fixes for the most part controls on a window.
But the rest will present them selves the first time you compile, and should be fixable with a Find/ReplaceAll
Thanks for the replies - I’ll try Resolve again and see how it works.
One other thing… I believe RESOLVE only fixes the “control”… but not any deprecated attributes that may be involved (like UseOldRenderer on a graphics item), or attempts to draw to a Canvas control outside of the paint event … those types of issues you will have to do manually
You’re right - Resolve works perfectly. I don’t know why I thought it didn’t before, but it did change all StaticText elements to Labels, as well as the other few things. Thanks for the help with this; I’m all set now.
Just wondering. Do you think that it would be possible for somebody to program something that converts everything perfectly. I was just wondering why Xojo does not do this? Is it because it would take to much time to do or something like that?
"could " it be done? yes…
but I think Xojo resources are better dedicated to bug fixes, features and fixing the IDE than something like this.
especially since this issue only comes up with a control type is deprecated (EditField to TextField) etc.
And using Resolve, and letting the compile find the rest is a small investment for the developer, but a huge one for Xojo.
Plus there are some situtions where casting and subclassing are involved which might be very difficult to transform without knowing the “intent” involved.