API 1: weird FolderItem

I was fighting since yesterday against a bad FolderItem and at last found (more or less) what happened…

I stored into a Text file a Folder Name on line 1, a File Name on Line 2 (and a number on line 3). That text file is saved into ApplicationData/My_App/The_Text_File.txt

I get the My_App Reference (FolderItem) from SpecialFolder.ApplicationFolder (and this works fine).

So, I read line 1 and build a FolderItem as a specific Folder Reference somethinglike:

DB_Folder_FI = Foo_FI.Child(Folder_TIS.ReadLine)

I do the same in a different variable with line 2 to build a file FolderItem. This part is always Nil.

Minutes ago, I found in the Debugger that this FolderItem is not a Directory as it normally is.

Of course, when I build a FolderItem to a file that resides inside that “non folder”, it goes Nil (as I saw in the debugger).

Extract of the debug part. Thye Foo variables are here only for debug purposes:

[code] Dim Foo_Str As String
Dim Foo_FI As FolderItem

Foo_Str = Prefs_TIS.ReadLine
Foo_FI = mSQL.gMaster_DB_FI // Was: mSQL.gMaster_DB_FI.TrueChild(Foo_Str)
Foo_FI = Foo_FI.Child(Foo_Str) // Foo_FI is Nil here[/code]

Idea ?

Does mSQL.gMaster_DB_FI exist as a directory or is it a file?

It’s a folder…

I started a debug session, minutes ago, and I wrote (at 24point another report).

As it comes from here to then, I found the answer by myself while writing the bug report.

In this case, I forgot to add a folder in building the FolderItem path. Of course, all folders exists, but one (in the parth) was missing.

Sorry for the buz …

PS: In the debugger, I copied the path of the builded FolderItem and pasted (still at 24 pixels height) it into TextEdit. I was ranting alone on a sunny afternoon 'till I saw the missing Folder… and the solution !