BBS: Inland Empire Archive Date: 11-26-92 (23:12) Number: 395 From: FRANKLIN BEAL Refer#: NONE To: CRAIG RANDLE Recvd: NO Subj: DIR 2/2 Conf: (2) Quik_Bas
' ------------------- part 2 of Getfiles.bas ---------------------------------
END
' =========================== Sub-Programs ==================================
'
' --------------------------- CountFiles ------------------------------------
SUB CountFiles (Srch$, NumFiles)
DIM DTA AS DTAType
NumFiles = 0
CALL SrchFile(Srch$, File$, DTA, Ecode)
DO UNTIL Ecode
CALL SrchNext(File$, DTA, Ecode)
NumFiles = NumFiles + 1
LOOP
END SUB
' --------------------------- GetFiles --------------------------------------
SUB GetFiles (Files$())
DIM DTA AS DTAType
Srch$ = Files$(0)
CALL SrchFile(Srch$, File$, DTA, Ecode)
C = 0
DO UNTIL Ecode
Files$(C) = File$
C = C + 1
CALL SrchNext(File$, DTA, Ecode)
LOOP
END SUB
' --------------------------- SrchFile --------------------------------------
SUB SrchFile (Srch$, File$, DTA AS DTAType, Ecode)
DIM InRegs AS RegTypeX
DIM OutRegs AS RegTypeX
DIM F AS STRING * 64
InRegs.ax = &H1A00
InRegs.ds = VARSEG(DTA)
InRegs.dx = VARPTR(DTA)
CALL InterruptX(&H21, InRegs, OutRegs)
F = Srch$ + CHR$(0)
InRegs.ax = &H4B00
InRegs.cx = 0
InRegs.ds = VARSEG(F)
InRegs.dx = VARPTR(F)
CALL InterruptX(&H21, InRegs, OutRegs)
File$ = MID$(DTA.A, 31)
Ecode = OutRegs.ax
END SUB
' --------------------------- SrchNext --------------------------------------
SUB SrchNext (File$, DTA AS DTAType, Ecode)
DIM InRegs AS RegTypeX
DIM OutRegs AS RegTypeX
DIM F AS STRING * 64
F = Srch$ + CHR$(0)
InRegs.ax = &H4F00
CALL InterruptX(&H21, InRegs, OutRegs)
File$ = MID$(DTA.A, 31)
Ecode = OutRegs.ax
END SUB
' ------------------------------ Cut Here ----------------------------------
L8R
Franklin Beal
* SLMR 2.0 * Going out of your mind? Pack light; it's a short trip!
--- WM v2.04/91-0012
* Origin: Com-Dat BBS Hillsboro, OR. HST (503) 681-0543 (1:105/314)

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