DirPlus does NOT allow me to easily do only 3 levels as required.
The following I believe should work but for an error insisting there is a missing comma in the Dir(#) ?
Suggestions
Code:
break on
global $CLIENT
global $LOCATION
global $PROJECT
dim $SOURCE[4]
;dim $CLIENT[9999]
;dim $LOCATION[200]
;dim $PROJECT[200]
debug on
$SOURCE[1] = READPROFILESTRING(@SCRIPTDIR + "\MENU.INI","DRIVES","SOURCE")
$SOURCE[2] = READPROFILESTRING(@SCRIPTDIR + "\MENU.INI","DRIVES","DEST")
$SOURCE[3] = READPROFILESTRING(@SCRIPTDIR + "\MENU.INI","DRIVES","ARC1")
$SOURCE[4] = READPROFILESTRING(@SCRIPTDIR + "\MENU.INI","DRIVES","ARC2")
if Open(2, "c:\dirlist.txt",5) = 0
for $s= 1 to 4
? "#"+$SOURCE[$s]
ClntDir($s)
next
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function ClntDir($S)
$CLIENT=Dir(""+$SOURCE[$s],0)
$CC=0
While Not @ERROR
If (16 & GetFileAttr($SOURCE[$s]+"\"+$CLIENT))
if not $CLIENT = "." and not $CLIENT = ".." and not $CLIENT = ""
$CC=$CC+1
$CLIENT[$CC] = $CLIENT
LocnDir($S,$CC)
endif
EndIf
$CLIENT = Dir() ; retrieve next Client
Loop
EndFunction
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function LocnDir($S,$CC)
$LOCATION=Dir(""+$SOURCE[$s]+"\"+$CLIENT[$CC],0)
$LC=0
While Not @ERROR
If (16 & GetFileAttr($SOURCE[$s]+"\"+$CLIENT[$CC]+"\"+$LOCATION))
if not $LOCATION = "." and not $LOCATION = ".." and not $LOCATION = ""
$LC=$LC+1
$LOCATION[$LC] = $LOCATION
ProjDir($S,$CC,$LC)
endif
endif
$LOCATION=Dir() ; retrieve next Location
Loop
EndFunction
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function ProjDir($S,$CC,$LC)
$PROJECT=Dir(""+$SOURCE[$s]+"\"+$CLIENT[$CC]+"\"+$LOCATION[$LC],0)
$PC=0
While Not @ERROR
If (16 & GetFileAttr($SOURCE[$s]+"\"+$CLIENT[$CC]+"\"+$LOCATION[$LC]+"\"+$PROJECT))
if not $PROJECT = "." and not $PROJECT = ".." and not $PROJECT = ""
$PC=$PC+1
$PROJECT[$PC] = $PROJECT
$LINE=$source[$s]+","+$client[$CC]+","+$location[$LC]+","+$project[$PC]+@CRLF
? ""+$LINE
$x = WRITELINE (2,$LINE)
endif
endif
$PROJECT=Dir() ; retrieve next Project
Loop
EndFunction