Question Of The Day!

 BBS: Inland Empire Archive
Date: 05-13-92 (14:48)             Number: 95
From: JEAN CREPEAU                 Refer#: NONE
  To: RONALD DERKIS                 Recvd: NO  
Subj: Question Of The Day!           Conf: (2) Quik_Bas
In a message to ALL, RONALD DERKIS wrote:
RD=> How do  you pull the  dir from the  current drive and  load it into  a
    array with out  it apearing on  the screen? A  simple question but  one
    that has puzzeled everyone!

        Use the following subroutines:

deflng a-z

type filedesc
reserved as string*21
attr as string*1
filetime as integer
filedate as integer
filesize as long
filename as string*13
end type

dim dta as filedesc

declare function findfirst%(x$,dta)
declare function findnext%()

function findfirst%(x$,dta as filedesc)
dim inreg as regtype,outreg as regtype,temp as string*128
interrupt &h21,inreg,outreg
interrupt &h21,inreg,outreg
findfirst=outreg.flags and 1
end function

function findnext%
dim inreg as regtype,outreg as regtype
interrupt &h21,inreg,outreg
findnext=outreg.flags and 1
end function

        To read the directory, call FINDFIRST with the filename your search
(it can be *.*  for instance). The filename  is in DTA.Filename field.  You
put this field  in your array  and call FINDNEXT.  The next filename  is in
DTA.Filename field. And you continue  until FINDNEXT returns 1 (that  means
there is no more file to check in the directory. Example:

Redim Dir$(127)
While R

 * Origin: INTERACESS Montreal (QC) Canada (514) 528-1415 (1:167/280)
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