>lnFiles = ADIR(laFileList, tcPath + "*.*", lcAttributes, tnFlag) >>It seems like laFileList is sent to .f., and I can't figure out why. Thanks Sergey!
>FUNCTION LoadOneDir(tcCursorName, tcPath, taPattern, tcAttributes, tnFlag, tcOpt, tlRecursive) >EXTERNAL ARRAY taPattern > >LOCAL lnFiles, i, laFileList[1], x, lcExtraAttr, llInclude, lcFileName, llBasicData >llBasicData = ("BASIC" $ tcOpt) > >IF NOT tlRecursive OR ("D" $ tcAttributes) > lcAttributes = tcAttributes >ELSE > lcAttributes = tcAttributes + "D" >ENDIF > >lnFiles = ADIR(laFileList, tcPath + "*.*", lcAttributes, tnFlag) >=ASORT(laFileList) > >FOR i=1 TO lnFiles > lcFileName = laFileList[i,1] > IF lcFileName = "." > LOOP > ENDIF > > IF NOT ("." $ lcFileName) > lcFileName = lcFileName + "." > ENDIF > llInclude = .F. > FOR x=1 TO ALEN(taPattern) > IF LIKE(taPattern[x], lcFileName) > llInclude = .T. > EXIT > ENDIF > ENDFOR > > IF llInclude AND ( NOT ("D" $ laFileList[i,5]) OR ("D" $ tcAttributes) ) > INSERT INTO (tcCursorName) ; > ( Path, FileName, FileSize, FileDate, FileTime, FileAttr) ; > VALUES (UPPER(tcPath), laFileList[i,1], ; > laFileList[i,2], laFileList[i,3], ; > laFileList[i,4], laFileList[i,5]) > IF NOT llBasicData > REPLACE FileExt WITH JUSTEXT(laFileList[i,1]) > ENDIF > ENDIF > > IF tlRecursive AND ("D" $ laFileList[i,5]) > *susp > = LoadOneDir(tcCursorName, ADDBS(ALLTRIM(tcPath) + ALLTRIM(laFileList[i,1])), ; > @taPattern, tcAttributes, tnFlag, tcOpt, tlRecursive) > ENDIF >ENDFOR > > >RETURN > >