*param adresar
set Default to "i:\food600\"
adresar = "c:\"
zalohovyadresar = "c:\zalohy\"
m.gcpri_path = "c:\tmp\"

gccollate = "CZECH"
_screen.FontName = "Courier"
set Century on
set Path To "\food600\progs\"
clos data
crea table soubory (adresar c(111), nazev c(111), atrib c(1), delka n(9), sumadelky n(11))
do jedenadresar with m.adresar

sele soubory
do while .t.
  locate for "D" $ atrib .and. delka = 0
  if found()
    repl delka with -1111111
    do jedenadresar with allt(adresar) + allt(nazev) + "\"
  else
    exit
  endif
enddo

delete for atrib = "D"
index on delka tag delka desc
sumadelky = 0
scan
   sumadelky = m.sumadelky + delka / 1000000
   gather field sumadelky memvar
endscan


**** **** **** **** **** **** **** **** **** **** **** **** 
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
