[futurebasic] Drag N Drop vs Files$

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 2003 : Group Archive : Group : All Groups

From: "Edwards, Waverly" <Waverly.Edwards@...>
Date: Mon, 1 Dec 2003 15:20:10 -0500
I cant figure this one out.  I drag and drop a finder folder into a window
to determine the contents of that folder.
If I drag & drop the folder I do not get the scan of the folders contents
but the contents of the folder it resides in (its parent folder).  If I user
FILES$ everything works perfectly.  I know that I have a real (valid)
filespec because I can reveal the folder once I retrieve the filespec given
to me by the drag manager.

I suspect this is some type of conversion problem where  USR SCANFOLDER
does not want a real filespec but I dont know how to get the conversion that
I desire.

The drag & drop code is a lot so I'm hoping someone knows why I'm having a
problem without having to send a boatload of code.

The question may arise as to why I havent just used _FSSpecOpen vs
_FSSpecFolder.  I need to drag a folder into a window which is why I want to
closely replicate the problem using _FSSpecFolder (which actually works
perfectly if I didnt need drag & drop into a window).

Any ideas.



INCLUDE  "Util_Files.incl"

local fn 

clear local
local fn getFolderContents
DIM fsr as FileScanRec
DIM fs  as FSSpec
DIM as str255 fileName

//fileName = FILES$ (_FSSpecOpen,"","",fs)
fileName      = FILES$ (_FSSpecFolder,"","",fs)
print "***"; fs.name

fsr.ScanSpec  = fs
fsr.ScanIndex = 0
LONG IF  fsr.FndrFlags and _finvisible
PRINT  fsr.ScanIndex,"Not Visible"
//PRINT  fsr.DataLen,"""";fsr.ScanSpec.name;""""
PRINT  fsr.ScanIndex,mki$(fsr.Type),
PRINT  fsr.DataLen,"""";fsr.ScanSpec.name;""""

end fn

fn getFolderContents