Folderitem syntax

Hi Everyone,
I have a question that might be really easy for most of you. My application is generating a PDF report that I am saving to a folder named “Facturas” on the desktop. What I want to do is save it in the same directory as my application which already has a folder called “facturas”, I tried to do this but get an error
I tried to read the documentation for FolderItem and I thought I did the same thing but there is something that I am missing.
Thank You

i think you need the new word and this pathmode
Constructor(path as String, pathMode as FolderItem.PathModes, followAlias as Boolean = true)

example how i create a not existing folder

var path as FolderItem = SpecialFolder.Desktop.Child("Folder")
if path.Exists = False then path.CreateFolder
var file as FolderItem= path.Child("file.pdf")

Thank you Markus,
You pointed me to the right direction. I ended up doing this and it works


And no worries. I remember when I started with Xojo over a decade ago. This FolderItem thing made me struggle the most. These days I can’t remember why, but it took me a while to understand as a beginner, probably because I was always in a rush when in need of it.

I remember that it helped me to take one day an hour or two and build an empty project and trying out all options of Folderitem and to debug it on all platforms and analysing what happened.

1 Like

Good idea Jeannot,
I think I will do the same thing. But I am beginning to understand how it works.

1 Like

Note that

var path as new FolderItem("")
path = path.child("facturas")

is the same as

var path as new FolderItem("facturas")

Thanks Tim,
Good to know.