adresar = "z:\sql_hluca_zaloha\"

CREATE TABLE soubory FREE (adresar c(111), nazev c(111), atrib c(1), delka I, databaza C(44), cas C(22), vysl C(22))
do jedenadresar with m.adresar

SCAN
    stem = JUSTSTEM(nazev)
    FOR iii = 1 TO 22
        cas = RIGHT(m.stem, m.iii)
        IF VAL(m.cas + "9") = 0
            REPLACE cas WITH RIGHT(m.stem, m.iii-1)
            REPLACE databaza WITH STRTRAN(m.stem, ALLTRIM(cas), "")
            REPLACE cas WITH LEFT(cas, 8)
            EXIT 
        ENDIF 
    ENDFOR 
ENDSCAN 

FOR iii = 0 TO 10
    dat_txt = LEFT(TTOC(DATE() - m.iii,1), 8)
    ? m.dat_txt 
    REPLACE ALL vysl with ALLTRIM(vysl) + IIF(cas = m.dat_txt, "*.", "..")
ENDFOR 


* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
proc jedenadresar
param adresar
pocet = adir(qqq, m.adresar + "*.*", "D")
for ii = 1 to m.pocet
  if left(qqq(ii, 1), 1) # "."
     insert into soubory (adresar, nazev, atrib, delka) ;
        value (lowe(m.adresar), lowe(qqq(ii, 1)), iif("D" $ qqq(ii, 5), "D", ""), qqq(ii, 2))
  endif
endfor
