ASORT(ladir,3,-1,1,1)So I opted for version two which works beautifully. I understand the what you did reading it as code - very clever
>>>>fso = CREATEOBJECT("Scripting.FileSystemObject") >>>>lnNum =adir(ladir,'c:\vault\FP*','D') &&& 'Directory names that start with FP >>>> asort(ladir,3) &&& XXX i need reverse sort so that latest directory shows up first >>>> >>>> for each ladir in 'c:\vault' &&& XXX go through each directory >>>> >>>> open directory ??? >>>> >>>> FSO.CopyFile() &&& copy all files in directory to c:/temp >>>> >>>>endfor >>>>>>>
>>>lnNum =adir(ladir,'c:\vault\FP*','D') && 'Directory names that start with FP >>>asort(ladir,3) && XXX i need reverse sort so that latest directory shows up first >>>FOR EACH lcdir IN ladir && XXX go through each directory >>> lcSource = ADDBS(lcdir)+"*.*" >>> COPY FILE (lcSource) TO "c:\temp\*.*" >>>ENDFOR >>>>>>
>>nwdir='c:\vault\' >>lnNum =adir(ladir,'c:\vault\FP*','D') && 'Directory names that start with FP >>asort(ladir,3) && XXX i need reverse sort so that latest directory shows up first >>FOR EACH lcdir IN ladir >> lcSource = nwdir+ADDBS(lcdir)+"*.*" >> COPY FILE (lcSource) TO "c:\temp\*.*" >>ENDFOR >>>
>... >ASORT(asd,3,-1,1,1) >... >>
>nNum =adir(ladir,'c:\vault\FP*','D') && 'Directory names that start with FP >asort(ladir,3) && XXX i need reverse sort so that latest directory shows up first >FOR lnFor = nNum TO 1 STEP -1 > IF NOT LEFT(ladir[lnFor,1],1) == "." > lcSource = nwdir+ADDBS(ladir[lnFor,1])+"*.*" > ... > ENDIF >NEXT >