DIM my_file$(500):REM holds current files.Make this as big as you think you will need
c%=0
PROClistdirectory(".bbc")
REPEAT
PRINT my_file$(c%)
c%+=1
UNTIL my_file$(c%)=""
WAIT 1000
END
DEF PROClistdirectory(ext$)
LOCAL dir%, sh%, res%,cou%
DIM dir% LOCAL 317
SYS "FindFirstFile", "*", dir% TO sh%
IF sh% <> -1 THEN
REPEAT
f$= $$(dir%+44)
IF RIGHT$(f$,4)= ext$ THEN my_file$(cou%)=f$:cou%+=1
REM PRINT RIGHT$(f$,4):REM enable this to see the files it hides
SYS "FindNextFile", sh%, dir% TO res%
UNTIL res% = 0
SYS "FindClose", sh%
ENDIF
ENDPROC
DIM my_files$(500):REM holds current files.Make this as big as you think you will need
numfiles%=FNlistdirectory(".bbc",my_files$())
FOR x%=0 TO numfiles%-1
PRINT my_files$(x%)
NEXT x%
END
DEF FNlistdirectory(ext$,store$())
LOCAL filedata%, searchhandle%, res%,c%
DIM filedata% LOCAL 317
SYS "FindFirstFile", "*"+ext$, filedata% TO searchhandle%
IF searchhandle% <> -1 THEN
REPEAT
store$(c%)=$$(filedata%+44)
c%+=1
SYS "FindNextFile", searchhandle%, filedata% TO res%
UNTIL res% = 0
SYS "FindClose", searchhandle%
ENDIF
=c%