I’m trying to use the new framework as much as possible, but there are some unfortunate names picked. One in particular is the type Text (not that I can come up with an alternative right now).
Text cannot be used as a property name anymore (makes sence, but is widely used), except when it’s by importing an older project (like from RB) where you already declared a ‘Text’ property as String.
Also, the TextArea does have a Text property, but it is a String.
So you end up typing stuff like:
myControl.TextValue = TextArea1.Text.ToText
where:
myControl.TextValue is of the type Text
TextArea1.Text is of the type String => .ToText
I know this is probably (hopefully) going away once everything is converted to the new framework, but as it is now, this is confusing.
Indeed But probably the TextArea control has not been rewritten with the new framework.
But as for now, We’re going to stick with String instead of the Text type anyway, as it is unbelievable slow compared to String. The speed is a disaster!
See the attached example (an experiment to translate our existing Language Engines to the new framework, so what it does will not make much sense).
The results are also slightly different (due to the ‘power’ of Text and the encodings I’ll presume and I haven’t got the time to check what exactly is different. Our existing engines handle the encodings very well with our own functions, but they are not build in this demo,)
I’m not sure I’d expect textfield/area’s to switch to Text type anytime soon. That would break a lot of code that has been promised to stay running for awhile. If anything we will get a new DesktopTextField like iOSTextField or Xojo.Desktop.TextField or some equivalent. The library icons is going to be a mess!
And adding an extra warning when you analyse the project that says something like: ‘Text cannot be a keyword’ (if the project has been imported from RB where it was allowed). Similar as when you try to enter it as a new one.
It can be deprecated and changed over the way StaticText was changed to Label, no? I’m not insisting on this, merely asking if it’s a potential option.
I must have a different IDE then, because mine says ‘The name connot be a keyword’ when I try to type Text into the Name field of a property
All joking aside, I understand what you mean Joe. All I was suggesting was giving some warning if indeed such a ‘bad idea’ occurs. As for now, it was only by accident I noticed I had a ‘Text as String’ property. I did change it in my code to ‘TextValue as String’ because there may be a version of Xojo some day that will not allow it. And I rather handle stuff like this now when I’m doing a conversion from RB to Xojo.