When I run my little program in the IDE debugger, everything runs smoothly. So, I thought it was time to try building this version under Linux (Mint). Just to test it. Linux runs in a Oracle VM VirtualBox.
But the build gives me a ‘UnsupportedFormatException’ and I can’t figure out why. It occurs in the following part of code: Var fP As New FolderItem(myAppPath + "SomeFileName.ext")
I checked multiple times but the path and file do exist. In the debugger it works without errors and as expected.
I can’t check the build under Windows (yet) as I’m still using the free version. I’m running the latest 2024r1.1 release.
Yes, the debugger runs in the VM. A folder is created with a name starting with ‘Debug’. The file that is checked is not in this Debug folder however. It is in a sub folder of the Xojo-project folder.
I was asking which OS the IDE was running under. I was trying to be sure that you were not running the IDE and debugging under (say) macOS, and then building for Linux.
Ok, I didn’t get that… No, I don’t mix OS systems.
Although I’m posting in the ‘GettingStarted’, I am not new to programming. I’m getting started with Xojo… By far not a professional, but with 20+ years of programming in VB6.
Var fP As New FolderItem(myFilePathPort)
Var fF As New FolderItem
fF = fP.Child("Portable.dat")
If fF <> Nil Then
' my code
The Linux build now gives fF = ‘Nil’. While this file ‘Portable.dat’ really exists in the subfolder.
Digging a bit further makes me discover that the problem lies in the folder definition:
In the debugger, I have to use: app.ExecutableFile.Parent.Parent.NativePath
While in the Linux build I need: app.ExecutableFile.Parent.NativePath
(so, just 1 ‘Parent’) And it works as expected…
Ah, I think I understand now. It has to do with the creation of the ‘DebugProjectName’ folder. The project subfolders are not copied to the ‘debug’ folder. Fully understandable.
I guess that using the constant ‘DebugBuild’ is the way to circumvent this issue?