2020r2 desktop changes

Some changes wont be a big deal
If you happened to use the style REALbasic.function name then some of those will need fixing as they have moved from the REALbasic framework into different ones. IF you need to prefix things with the right namespace you’ll have to sort out which one it got moved to but its USUALLY one named the same as the data type. So if you used to write

Dim s As String 

s = REALbasic.Titlecase(someOtherStringVar) // or TitleCase("foo")
s  = someOtherStringVar.Titlecase // this form wont allow "foo".Titlecase

this will need to become

Dim s As String 

s = String.Titlecase(someOtherStringVar) 
s  = someOtherStringVar.Titlecase // this form still wont allow "foo".Titlecase


Some others may cause more work since the replacement isnt as capable
ie/

Dim tinfo1 As Xojo.Introspection.TypeInfo = GetTypeInfo(Integer) // this works in versions up to 2020r2
Dim tinfo As Introspection.TypeInfo = GetTypeInfo( Integer ) // this does not work in 2020r2

Application Deprecated CurrentThread
replace with Thread.Current

Combobox Deprecated Value replace with Text

DateTime
added Public Function ToString(dateStyle As FormatStyles = FormatStyles.Medium, timeStyle As FormatStyles = FormatStyles.Medium) As String
removed Public Function ToString(loc As Locale = Nil, dateStyle As FormatStyles = FormatStyles.Medium, timeStyle As FormatStyles = FormatStyles.Medium) As String
added Public Function ToString(loc As Locale, dateStyle As FormatStyles = FormatStyles.Medium, timeStyle As FormatStyles = FormatStyles.Medium) As String

DateTimePicker added

EndOfLine
added property Android as string
added Public Shared Property CR As String
added Public Shared Property CRLF As String
added Public Shared Property iOS As String
added Public Shared Property LF As String

Graphics
added Public Property Brush As GraphicsBrush
added Public Function LineDash() As Double()
added Public Property LineCap As LineCapTypes
added Public Enum LineCapTypes As Global.Integer
added Public Property LineDashOffset As Double
added Public Property LineJoin As LineJoinTypes
added Public Enum LineJoinTypes As Integer
added Public Property ShadowBrush As ShadowBrush

added Class GraphicsBrush

Class HTTPSecureSocket Deprecated
replace with URLConnection

Class HTTPSocket Deprecated
replace with URLConnection

Label
Text no longer marked Deprecated
Value Deprecated replace with Text

added Class LinearGradientBrush

Listbox header height is now settable

MenuItem
Text no longer Deprecated
Value Deprecated replace with Text

Movie
Deprecated BaseMovieHeight replace with Height
Deprecated) BaseMovieWidth replace with Width
Deprecated Handle
Deprecated MovieHeight
Deprecated MovieWidth
added Property Height As Integer
added Property Width As Integer

Picture
added HandleType iOSUIImage = 6

added Class PictureBrush

PopupMenu
Deprecated SelectedRowValue replace with SelectedRow

added Class RadialGradientBrush

Module REALbasic
removed Abs
removed ACos
removed ASin
removed ATan
removed ATan2
removed CDbl
removed Ceil
removed Ceiling
removed CLong
removed ConvertEncoding
removed Cos
removed CountFields
removed DecodeHex
removed DefineEncoding
removed EncodeHex
removed Encoding
removed Exp
removed Floor
removed InStr
removed InStrB
removed Left
removed Log
removed Lowercase
removed Max
removed Min
removed NthField
removed Pow
removed Replace
removed ReplaceAll
removed Right
removed Rnd
removed Round
removed Sign
removed Sin
removed Split
removed Sqrt
removed StrComp
removed Tan
removed Titlecase
removed Trim
removed Uppercase
removed Val
removed VarType

added Class SearchField

added Class ShadowBrush

String module
added CDbl(Extends str As String) As Double
added Protected Function Chr(value As Integer) As String
added Global Function CLong(Extends str As String) As Int64
added Global Function ConvertEncoding(Extends text As String, newEncoding As TextEncoding) As String
added Global Function CountFields(Extends aString As String, separator As String) As Integer
added Global Function DefineEncoding(Extends text As String, encoding As TextEncoding) As String
added Global Function Encoding(Extends Str As String) As TextEncoding
added Global Function InStr(Extends source As String, start As Integer = 0, find As String) As Integer
added Global Function InStrB(Extends source As String, start As Integer = 0, find As String) As Integer
addedGlobal Function Left(Extends str As String, count As Integer) As String
added Global Function Lowercase(Extends Str As String) As String
added Global Function NthField(Extends aString As String, separator As String, index As Integer) As String
added Global Function Replace(Extends sourceString As String, substring As String, replacementString As String) As String
added Global Function ReplaceAll(Extends sourceString As String, substring As String, replacementString As String) As String
added Global Function Right(Extends str As String, count As Integer) As String
added Global Function Split(Extends source As String, delimiter As String = ” “) As String()
added Global Function StrComp(a As String, b As String, compareMode As Integer) As Integer
added Global Function Titlecase(Extends Str As String) As String
added Global Function Trim(Extends s As String) As String
added Global Function Uppercase(Extends Str As String) As String
added Global Function Val(Extends str As String) As Double

Class TextArea
Deprecated Value replace with Text

Class TextEdit
Deprecated Value replace with Text

Class TextField
Deprecated Value replace with Text

Class Thread
added Public Shared Property Current As Thread
added Public Property CurrentThread As Thread
added Public Property CurrentThread1 As Thread
added Public Shared Sub SleepCurrent(milliseconds As Integer)
added Public Shared Sub YieldToNext()

added Class Worker

Module Xojo.Core.
Deprecated Xojo.Core.Date replace with DateTime
Deprecated Xojo.Core.DateIntervalreplace with DateInterval
Deprecated Xojo.Core.Dictionaryreplace with Dictionary
Deprecated Xojo.Core.DictionaryEntryreplace with DictionaryEntry
Deprecated Xojo.Core.Localereplace with Locale
Deprecated Xojo.Core.MemoryBlockreplace with MemoryBlock
Deprecated Xojo.Core.MutableMemoryBlock replace with MemoryBlock
Deprecated Xojo.Core.Pointreplace with Point
Deprecated Xojo.Core.Rectreplace with Rect
Deprecated Xojo.Core.Sizereplace with Size
Deprecated Xojo.Core.Timerreplace with Timer
Deprecated Xojo.Core.TimeZonereplace with TimeZone
Deprecated Xojo.Core.WeakRefreplace with WeakRef

  Module Xojo.Data
Deprecated Xojo.Core.InvalidJSONException replace with InvalidJSONException

Module Xojo.Introspection
Deprecated Xojo.Introspection.AttributeInfo replace with AttributeInfo
Deprecated Xojo.Introspection.ConstructorInfo replace with ConstructorInfo
Deprecated Xojo.Introspection.MemberInfo replace with MemberInfo
Deprecated Xojo.Introspection.MethodInfo replace with MethodInfo
Deprecated Xojo.Introspection.ParameterInfo replace withParameterInfo
Deprecated Xojo.Introspection.PropertyInfo replace with PropertyInfo
Deprecated Xojo.Introspection.TypeInfo replace with TypeInfo

Module Xojo.IO
Deprecated Xojo.IO.BinaryStream replace with BinaryStream
Deprecated Xojo.IO.FolderItem replace with FolderItem
Deprecated Xojo.IO.IOException replace with IOException
Deprecated Xojo.IO.SpecialFolder replace with SpecialFolder
Deprecated Xojo.IO.TextInputStream replace with TextInputStream
Deprecated Xojo.IO.TextOutputStream replace with TextOutputStream

Module Xojo
added Abs(value As Double) As Double
added ACos(value As Double) As Double
added ASin(value As Double) As Double
added ATan(value As Double) As Double
added ATan2(y As Double, x As Double) As Double
added Ceil(value As Double) As Double
added Ceiling(value As Double) As Double
added Cos(value As Double) As Double
added DecodeHex(s As String) As String
added EncodeHex(s As String, insertSpaces As Boolean = False) As String
added Exp(value As Double) As Double
added Floor(value As Double) As Double
added Log(value As Double) As Double
added Max(value1 As Double, value2 As Double, ParamArray moreValues() As Double) As Double
added Min(value1 As Double, value2 As Double, ParamArray moreValues() As Double) As Double
added Pow(base As Double, exponent As Double) As Double
added Rnd() As Double
added Round(value As Double) As Double
added Sign(value As Double) As Integer
added Sin(value As Double) As Double
added Sqrt(value As Double) As Double
added Tan(value As Double) As Double
added VarType(value As Variant) As Integer

IOSKeyboardTypes
added Deprecated iOSKeyboardTypes replace with MobileTextField.InputTypes


What I sent vs what I got

Sent directly to Dana Brown Thur Nov 19, 2020 @2:01 PM (typos and all)

No I’m not writing to appeal being suspended

What I am wondering is if you would alter this to be “silenced” instead of “suspended”
Functionally silenced has the effect of making it so I cannot post – but it does allow me to log in an access things like the testers forum to be able to download new builds

In the long run the effect is stil lthat I’m not an actuve particpating member since I cannot post in any way
see – https://meta.discourse.org/t/discourse-moderation-guide/63116 “Silence the user”

————–

Thats it. The whole email.

I decided I would wait a decent amount of time before posting anything. Its been a week.

UPDATE : 2:01 Tue Nov 24 – No reply. Only silence.

UPDATE : 2:01 Wed Nov 25 – No reply. Only silence.

UPDATE : 2:01 Thu Nov 26 – No reply. Only silence.

If it compiles when I press run …

Folks come to expect that if I press run and the code compiles that when I press build it will still compile.
And realistically why shouldn’t it ?
Run builds an actual application and, for the most part, the only difference was that now in a Xojo debug run the debug app has a bit of code in it for the IDE to talk to and control and query back and forth.

Other than that its “the same”

Except now.

With the addition of Workers what can happen is you can write code that, when you RUN, uses threads. And that means that certain code will appear to compile – although it might not do anything useful.

But when you BUILD now the IDE will compile that worker in to a separate console application.

Which means that your code that worked while you hit run all the time might no longer work. Or even compile.

I submitted this bug report about it Oct 10, 2020

Things that go unanswered

From Xojo’s forums where no one has bothered to answer that _could_ answer

Container Control Init

Should Container Controls be receiving set calls on computed properties before the open event fires?

Yes. When Xojo creates the layout that contains the container it effectively sets EVERY property regardless. Its as if you wrote :

dim c as new ContainerControl
c.property = value
c.property = value
... and so one for EVERY property ...
and now the Open Event can be raised

Setting left/right margins to 0

I am trying to add “MarginLeft=0” and “MarginRight=0” to the setupstring. I have
settings=ps.SetupString and can dump the values in settings but the margins are not setup by default so I want to force it.

I’ve searched for a while but cannot find a way to add those two entries.

In general no you cant / shouldnt try to stuff values in there manually as this “string” is not meant to always be human readable to modifiable like this. MBS has plugins for Windows & MacOS that will permit you to control this in greater depth

Is it built in or …

Xojo has a pretty handy language feature called “extension methods”

They can be used by anyone to add functionality to any existing class. And they cane/have been used by Xojo to do exactly this.

For instance, the currency class has no built in functions to convert itself to a string, from a string, etc. Yet when you enter code like

Dim c As Currency

s = Currency.

and press tab you will see various methods presented.

You can see some of this when you select one option and then view the hint at the bottom of the editor

Normally it doesnt matter that a function is or isnt done this way.

Unless you expect things in XojoScript to also have these functions. They wont exist because the module(s) that provide all these handy functions are not part of the framework available to XojoScript.

And so code that would work in Xojo may not work in XojoScript.

Is this just rearranging deck chairs ?

On the forum theres a long thread about altering how the points in Feedback work and how they can be assigned.

I have to admit that from my perspective, and seemingly from others, the issue is not so much with gathering reports, but the “processes” that occur after gathering reports.

Currently we can assign points to reports by making them favourites. This at least indicates the 5 items each person considers high priority. And because more points go to higher priced licenses it also gives people who hold Pro and Pro+ licenses more influence when they do select a case to be a favourite.

Xojo frequently says that feedback is NOT the only criteria they use. They also consider the scope of the issue. I’m not sure how they assess this though.

Isn’t that what a lot of users making a case one of their top 5 cases _should_ indicate already ?

Even if the points system is overhauled does that changes the internal processes they have around Feedback ?

What priority _should_ a bug that causes a reproducible crash have – whether it has points assigned or not ? Or an exception that causes the IDE to lose whatever it is you’ve been working on ?

It would seem to me that those kinds of nicely reproducible bugs that cause fatal problems should have high priority regardless of how many points they have.

I’d think the KIND of case matters – sometimes more than how many points it has.

As Thom said on that thread

That’s where I think Feedback’s effort needs to be. The human element. Not to say the technical element is perfect, of course.

https://forum.xojo.com/t/the-feedback-points-system/57327/37

Thom wrote the initial versions of Feedback – they been updated since – but he’s not wrong. He worked at Xojo. As did I.

Case report acquisition isnt the issue. And in my opinion rearranging or redefining the points system is just rearranging deck chairs and not dealing with the actual problem.

Careful with your IDE & Xojo scripts

The project I’m working on uses a TON of XojoScript.

And for the most part I can test things in the IDE script editor window since that also runs XojoScript code. It just has a different context assigned to it that permit access to the IDE.

However, recently my apps with the XojoScript code would crash.

So I then tried the code in the IDE script editor window and to my surprise that crashed the entire IDE.

You can see one of my vastly trimmed down scripts in the feedback case attached to this report and this other one

Heads up !

Compat flags

What are these things and what use do they have ?

Buried away on the advanced tab of the inspector for most things is a little section that has a lot of check boxes labelled Desktop, Web, Console, iOS that I’m sure most folks dont know what they are for or what you’d use them for.

For your own code these can be immensely useful. If you happen to want to share code between project of different kids then you may need to use these.

What they let you do is create classes or code that can have different implementations depending on what kind of project the code is in.

For instance suppose you have a library of code you were working on, your own “framework” for an app that had aspects that ran on all targets.

You might create a module for your framework code. And in there it could have several implementations of your crucial method, Foo() – one for each of console, web desktop and even iOS as follows

Public Sub Foo(param as string)
  MsgBox "desktop foo !"  
End Sub
Public Sub Foo(param as string)
  MsgBox "Web foo !"
End Sub
Public Sub Foo(param as string)
  MsgBox "Console foo !"  
End Sub
Public Sub Foo(param as Text)
  Dim helloMessage As New iOSMessageBox
  HelloMessage.Title = "Hello"
  HelloMessage.Message = "iOS foo !"
  HelloMessage.Show // Not modal, so code does not pause here
End Sub

Yeah I realize its not sophisticated. Thats not the point. Maybe this ias a method that you have for calculating some vital function for your app. Or for fetching some data from a web service.

The compatibility flags for each of these would be set differently. The one that sayd “Desktop foo” should be marked for desktop only

The web one would be marked for web only

And similarly for the iOS and Console one

So now we have this handy dandy super module with all kinds of functionality in it that …

yeah … this is an example OK ?

I have my module set up in a desktop application and if, in Window1.Open I put


module1.Foo(CurrentMethodName)

Guess which method gets executed ?

If you guessed the one marked compatible with desktop apps then you’re quite right.

And if we take this handy dandy module and copy & paste it into a Console app, guess which one runs ?

Web

And even iOS

Thats all well and good but whats going on ?

Is all this magic happening at runtime and all the code is in the app all the time ?

Not at all.

The IDE, at compile time, selects the compatible version of the methods to compile depending on how the compatibility flags are set. And it only compiles those.

So despite our handy dandy module having all those different versions in it only the desktop ones will get compiled in a desktop app, only the web ones in the web app, and so on.

I hope you can make good use of this !