Xojo Conferences
MBSOct2019CologneDE
XDCMarch2020NashvilleUS

« Hotel rooms for Europ… | Home | MBS Booth ready for F… »

NativePath vs. AbsolutePath


For years Xojo had three types of paths on the folderItem class:
  • AbsolutePath
    For Mac the old MacClassic style for paths with semicolon as divider. For Windows and Linux this is native path.
  • NativePath, the native path for the OS, so you get the POSIX style path on MacOS. Same as absolute path for Linux and Windows. Introduced with Xojo 2013.
  • ShellPath, the escaped path for use in shell commands with shell class.
AbsolutePath has been deprecated for a while and may finally go with the next Xojo version. Time enough for us to look through thousands (Sic!) of examples and code snippets to find all places with AbsolutePath. Often we had code like this already:

#If RBVersion < 2013 Then
MsgBox "Failed to create file " + f.AbsolutePath
#Else
MsgBox "Failed to create file " + f.NativePath
#EndIf

But it is very annoying to write #If into hundreds of projects.

We got a nice idea to keep projects compiling in Real Studio (doesn't know NativePath) and the future Xojo versions (doesn't know AbsolutePath): Via plugin we add NativePath for Real Studio. All our projects can use NativePath and compile in older/newer versions.

So if you have AbsolutePath in the projects, it may be a good idea to replace it! Same for PathTypeAbsolute.
31 07 19 - 19:25
one comment

Nice one! Thanks!
Markus Winter - 02 08 19 - 21:40


  
Remember personal info?

Emoticons / Textile


Notify:
Hide email:

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.