> >DECLARE INTEGER CreateDirectory IN kernel32; >STRING lpPathName, STRING @lpSecurityAttr > >sDirectory='D:\Data\Files' >OriginalFile=E:\Data\123.pcl >OriginalFile=E:\Data\456.pcl > > >SET DEFAULT TO (sDirectory) >CreateDirectory(JUSTSTEM(OriginalFile),0) && Does Not Create any Directory with the Required FileName >cDIR=JUSTSTEM(OriginalFile) >CreateDirectory('&cDIR',0) && && Does Not Create any Directory with the Required FileName >CreateDirectory('cDIR',0) && Gives Creates a Directory with Name cDIR and Not in the Name of The File >CreateDirectory(&cDIR,0) && Gives Error Data Type Mismatch >CreateDirectory(cDIR,0) Does Not Create any Directory with the Required FileName >>
OriginalFile=E:\Data\123.pcl OriginalFile=E:\Data\456.pclor did you actually mean to write
OriginalFile='E:\Data\123.pcl' OriginalFile='E:\Data\456.pcl'also, as Mike had suggested, perhaps you should consider using the built-in MD/MKDIR command in VFP rather than API call -- generally better idea to use built-in rather than external (unless there is a specific reason to do so -- e.g. built-in command has limitation). One other thing -- you'll have to be careful about relative directory addressing -- especially when API calls are involved, or when anything outside of FoxPro is used. I've seen situations where the "current directory" could change unexpectedly. When there is a doubt, it's probably a good idea to use full paths.