(1 of 3) DIR$ to array

 BBS: Inland Empire Archive
Date: 06-10-93 (00:46)             Number: 266
From: TIM BENNETT                  Refer#: NONE
  To: EVENS MARTIN                  Recvd: NO  
Subj: (1 of 3) DIR$ to array         Conf: (2) Quik_Bas
'________O_/________________________| SNIP |______________________\_O_______
'        O \                        | HERE |                      / O
'This file created by PostIt! v6.0.
'>>> Start of page 1.


DECLARE SUB fulldir (dir$(), dirnum%, filedir%, path$, wildcard$)

TYPE FileFindBuf
        DOS            AS STRING * 19
        CreateTime     AS STRING * 1
        Attributes     AS INTEGER
        AccessTime     AS INTEGER
        AccessDate     AS INTEGER
        FileSize       AS LONG
        FileName       AS STRING * 13

TYPE Register
        ax    AS INTEGER
        bx    AS INTEGER
        cx    AS INTEGER
        dx    AS INTEGER
        bp    AS INTEGER
        si    AS INTEGER
        di    AS INTEGER
        flags AS INTEGER
        ds    AS INTEGER
        es    AS INTEGER

sta% = 550
DIM SHARED dir$(sta%)
path$ = "c:\*.*"

fulldir(dir$(), dirnum%, 1, path$, wildcard$)
PRINT dirnum%
FOR m = 1 TO dirnum%
PRINT dir$(m)
PRINT dirnum%

SUB pfulldir (dir$(), dirnum, filedir, path$, wildcard$)
        DIM inreg AS Register, outreg AS Register
        DIM Buffer AS FileFindBuf
        dirnum = 0
        IF path$ > "" AND INSTR(path$, ".") = 0 AND_
 RIGHT$(path$, 1) <> "\" THEN
        path$ = path$ + "\"
        IF RIGHT$(path$, 1) = "\" THEN path$ = path$ + "*.*"
        END IF
        IF wildcard$ = "" THEN
                wildcard$ = "*.*"
        END IF

        IF path$ = "" THEN
        'Get Current Drive

                inreg.ax = &H1900
                CALL Interrupt(&H21, inreg, inreg)
                drive$ = CHR$(65 + inreg.ax MOD 256)
        'Get Current Path
                DIM PathSize AS STRING * 64
                inreg.ax = &H4700
                inreg.dx = ASC(drive$) - 64
                inreg.ds = VARSEG(PathSize)

'>>> Continued on page 2

... Old MacDonald had a computer, with EIA I/O...
--- GEcho/beta
 * Origin: Home - FalconWorks SoftWare - Mail Only (1:362/466.0)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET