CetElt is a FolderItem which can’t be Nil
SepAbsPath is a String character separator of path (":" on Mac and “” on Windows and “/” on Linux)
TampText is a String which contains the Path of CetElt (same as if I do TampText : CetElt.AbsoluthPath
TampText = CetElt.Name
If CetElt.Directory Then TampText = TampText + SepAbsPath
CetElt = CetElt.Parent
While not(CetElt = Nil)
TampText = CetElt.Name + SepAbsPath + TampText
CetElt = CetElt.Parent
Wend
MsgBox TampText
If CetElt is a FolderItem on a removable volume and this volume has been ejected, then While Wend never finish.
If I pause the Debug, it indicate nothing for CetElt but that CetElt.Parent is Nil.
A workarround is to test CetElt.Parent.Name , if it’s “” then I exit the loop.
Before report the Bug, I would like to know if I misunderstood something.
I’m running the last Xojo version with Mac OS X El Capitan 10.11.6 (15G1510).
Edit : I read old note in my program and I wrote long time ago that if I do CetElt.AbsoluthPath when CetElt was on an ejected volume it freeze the application (same problem then).
When the parent of a FolderItem is Nil it means you already get the top FolderItem (the folderItem of the root Hard Disk, MemoryKey, CD/DVD/BluRay, whatever).
IMHO.
In the docuentation (FolderItem.Parent) it is said:
If the volume is mounted, I obtain the string path for CetElt : “MyVolume:MyFolder:MySubFolder:MyFile.txt”
It works well, I finish the loop when I’m to Volume as its parent is Nil.
If I eject the Volume after have defined CetElt to the item on this volume, I obtain “::::::::::::::::::MyFile.txt” infinitely.