[futurebasic] Re: [FB] FN folderExists%(fldrName$,inThisWDrefNum%)

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

From: Mikearrony@...
Date: Sun, 12 Dec 1999 10:48:12 EST
This is the begining of an FN that I use for checking for the System Folder 
and then checks for the Preference Folder within the System Folder.   I 
didn't include the rest of the FN since it doesn't apply to the question.  
(if the folder exists it writes or reads the target file to the folder, if 
folder doesn't exist then it creates the folder)

LOCAL FN PreReg
DIM sysWDRefNum%,prefWDRefNum%,pathName$,filename$
pathName$ = ":Preferences:DVP Preferences"
filename$ = "DVP Preferences"
sysWDRefNum% = SYSTEM(_sysVol)
sysWDRefNum% = FOLDER("",sysWDRefNum%)
prefWDRefNum% = FOLDER("Preferences",0)
LONG IF prefWDRefNum% = 0            '/// if no preference folder then create 
it.
  Newfolder% = FOLDER("Preferences",sysWDRefNum%)
  prefWDRefNum% = FOLDER("Preferences",0)
END IF
err = FN IsFileThere% ("DVP Preferences",prefWDRefNum%)  
                              '///(DVP Preferences is the target file)
...............
...............
End FN

Mike