*CountFiles.PRG LPARAMETERS m.tcSkeleton IF VARTYPE(m.tcSkeleton) # "C" ; OR EMPTY(m.tcSkeleton) *Invalid function, argument, type or count. ERROR 11 ENDIF LOCAL ; m.lnCount, ; m.lcFile m.lnCount = 0 *Get the first filename. m.lcFile = SYS(2000,m.tcSkeleton) *Continue until all files are processed. DO WHILE NOT EMPTY(m.lcFile) m.lnCount = m.lnCount + 1 *Get the next filename. m.lcFile = SYS(2000,m.tcSkeleton,1) ENDDO RETURN m.lnCount