Learning Xojo

As mentioned, I converted two Xojo libraries from API1 to API2:

Xojo StringUtils Harness API2
Joe Strout wrote ages ago a toolset for string manipilations beyond Xojo’s out-of-the-box functionality…
Xojo ArrayUtils API2
After my conversion of Joe Strout’s “StringUtils Harness” to API2 it probably doesn’t come at a surprise that I converted as well his…

Updates

This article is about changes made after the initial conversion and reported by other Xojo users.

Where I can, I’ll comment those changes. The involved repositories are always updated on my github repositories before updating this article.

Thank you, to all contributors!

array.Count

Robert Livingstone reported this change request. Robert is right that since Xojo Release 2019r2 we can make use of this command, and it is definitely more elegant than :

array.LastIndex + 1

It’s important to note that if you analyze your project in the Xojo IDE it will point you to convert the former Ubound( array ) command to array.LastIndex but doesn’t give you of course the hint that array.Count exists. For better readability you should memorize this new command.

array.ResizeTo

This is yet another new command where the Project Analyse doesn’t point you to, but again Robert Livingstone did — thank you! From reading the Xojo documentation Redim is as well outdated:

Redim exists for Visual Basic compatibility only. Use Arrays.ResizeTo instead.

I updated the repositories and all “Redim”s are now replaced by the respective array.ResizeTo commands.

Please note that the Xojo IDE doesn’t point you to the fact that “Var” is preferred over “Dim”. However, I had made that change already in the original version.

Update 2020-DEC-30:

  • Method HexB used the deprecated version “RBVersion” in Stringutils (This item was deprecated in version 2013r1). Command replaced with “XojoVersion” as a replacement.
  • In the comments for EditDistance changed “StringUtils” to “strings”.
  • In the “Metaphone” method of the StringUtils the “Dim” statements remained. They are now replaced by “Var”.

Update 2021-JAN-04:

string.EndsWith

Version 2.5 Renamed method “EndsWidth” to “EndsWithOld” as Xojo has implemented “EndsWidth” into the core in late 2019.

Update 2021-FEB-01:

Version 2.6 Deleted method isEmpty, as meanwhile part of Xojo Core.

Comments

Sign in or become a blog.xojoDOCs.com member to join the conversation.
Just enter your email below to get a log in link.



You’ve successfully subscribed to blog.xojoDOCs.com
Welcome back! You’ve successfully signed in.
Great! You’ve successfully signed up.
Your link has expired
Success! Check your email for magic link to sign-in.