How to programmatically distinguish between REAL Studio and Xojo

For opensource code, etc, it is beneficial that it works across different versions of the IDE. It’s also beneficial that code generates as few (hopefully none) warnings as possible when it’s being analyzed, especially when opensource projects are catered towards a beginner community.

For instance FolderItem.Absolute Path was ok up until now. Starting with Xojo 2013r1, a deprecation warning is displayed, advising the user to use FolderItem.NativePath. However, NativePath is not recognized by any REALStudio version.
So, to avoid that, one would write their code like this:

#if RBVersion >= 2013 // use NativePath #else // use AbsolutePath #endif
This works fine on REALStudio as well as Xojo, but Xojo generates a deprecation warning saying that XojoVersion should be used instead of RBVersion. However, as expected, XojoVersion is not recognized by any REALStudio version.

Is there a way to distinguish the version of the ID being used without causing warnings or errors on one version or the other?

I’ve been using RBVersion without any warnings in Xojo.

I found that once I used Xojo to save a project… RS2012 could not read it again… even in XML format

Heck even UltraEdit gave me fits when trying to compare a XML saved with Xojo and a similar one saved with RS2012

Open a new thread with proper title about this problem and give detail there. Xojo needs to know.

You are correct, the IDE doesn’t warn about this yet, but the language reference clearly states that RBVersion has been deprecated in favor of XojoVersion:
http://documentation.xojo.com/index.php/RBVersion

[quote=11396:@Roger Meier]You are correct, the IDE doesn’t warn about this yet, but the language reference clearly states that RBVersion has been deprecated in favor of XojoVersion:
http://documentation.xojo.com/index.php/RBVersion[/quote]
The documentation page says it’s deprecated, but the official deprecations listing doesn’t mention it. My guess is that RBVersion is now deprecated but isn’t slated for removal. I doubt Xojo would make so much old code instantly broken for branding purposes.

I just saw that AbsollutePath has been deprecated for NativePath.

I tried replacing it in one of hundreds (well it seems like that many) of spots.

It broke it. The reason, No forward slash at end of folder!

This was not the beta but the first release.

What is a poor programmer to do.

I’ve been using this and then just doing a global search and replace between “AbsolutePath” and “AbsolutePath_”

Function AbsolutePath_(Extends f As FolderItem) As String #If RBVersion >= 2013 Then Return f.NativePath #Else Return f.AbsolutePath #endif End Function

You could do something similar, and appending the ending slash if need be.

[quote=11420:@Richard Albrecht]I just saw that AbsollutePath has been deprecated for NativePath.

I tried replacing it in one of hundreds (well it seems like that many) of spots.

It broke it. The reason, No forward slash at end of folder!

This was not the beta but the first release.

What is a poor programmer to do.[/quote]

<https://xojo.com/issue/26264> was submitted on April 12th.

[quote=11422:@Andrew Lambert]I’ve been using this and then just doing a global search and replace between “AbsolutePath” and “AbsolutePath_”

Function AbsolutePath_(Extends f As FolderItem) As String #If RBVersion >= 2013 Then Return f.NativePath #Else Return f.AbsolutePath #endif End Function

You could do something similar, and appending the ending slash if need be.[/quote]

That’s a nice and simple solution and will work until <https://xojo.com/issue/26264> gets some attention and it gets fixed.

It must be a private case; I can’t see it.

It’s just for Alpha and Beta testers but should be opened up to everyone now. For the record, it was marked as Verified and then Fixed today.

Everything from Real Studio has been aliased in Xojo. So you can use the keywords inversely… and there is a reason why alpha and beta information stays alpha/beta information. There is alpha information beta users cannot see as well within the development hierarchy. When it is no longer alpha/beta information, it is released for viewing…being fixed today you won’t see it in place until 2013r1.1 :slight_smile: