Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Toolbox: GetFileList
#1
Standard Toolbox message:  As I'm working up my new library (details here: https://qb64phoenix.com/forum/showthread.php?tid=2085), I'm going to be working up samples and demos highlighting how simple I'm trying to make it to use all these additional subs and functions.  Many of these routines I've uploaded in one version, demo, sample, or another, over the years, but I'm changing the format on a few of them for simplicity's sake.  

To run this download:
1) First head your browser over to: https://github.com/SteveMcNeill/QB64-Pho...on-Toolbox
2) Click the GREEN <> Code button.  It stands out; it's the only green item on the whole page.
3) Click the "Download Zip" link and you'll download all the files in the Github down to your PC.
4) Extract that file, as you would any ZIP file before trying to use it.
5) Start QB64, navigate to that file folder that you extracted things to, and open the "Samples" folder.

In this case, you can select "GetFileList.bas" and run it.  It contains the code below:

Code: (Select All)
$LET INCLUDE_ALL = TRUE
'$INCLUDE:'..\Library Files\Toolbox.BI'

DIM AS LONG i

GetFileList _CWD$
FOR i = 1 TO UBOUND(FileList)
    PRINT FileList(i);
    IF _FILEEXISTS(FileList(i)) THEN
        PRINT "(File)"
    ELSEIF _DIREXISTS(FileList(i)) THEN
        PRINT "(Dir)"
    ELSE
        PRINT "(Unidentified)"
    END IF
NEXT


'$INCLUDE:'..\Library Files\Toolbox.BM'

That's all there is to it!  Simple as can be, right?  The output should be something similar to the following:

   
Reply




Users browsing this thread: 1 Guest(s)