=========================================================================== BBS: The Abacus * HST/DS * Potterville MI Date: 02-25-93 (23:55) Number: 44 From: ROB MCKEE Refer#: NONE To: OWEN GIBBINS Recvd: NO Subj: DIRECTORIES 1/3 Conf: (35) Quick Basi --------------------------------------------------------------------------- Hello Owen! You wrote to All: OG> In BASIC, how do you get a list all the files and OG> subdirectories in the current directory. I know there's the OG> FILES command, but how do you store every OG> filename/subdirectory name in a variable. Also, I don't want OG> to have to shell to DOS. In QB45 or PDS: ' $DYNAMIC TYPE RegTypeX ax AS INTEGER bx AS INTEGER cx AS INTEGER dx AS INTEGER bp AS INTEGER si AS INTEGER di AS INTEGER flag AS INTEGER ds AS INTEGER es AS INTEGER END TYPE TYPE DFileType Fname AS STRING * 12 FDate AS STRING * 8 FTime AS STRING * 8 cattr AS STRING * 7 DSize AS STRING * 10 DSlack AS INTEGER attribute AS INTEGER END TYPE TYPE FileType Fname AS STRING * 12 year AS INTEGER month AS INTEGER day AS INTEGER FDate AS STRING * 10 hour AS INTEGER minute AS INTEGER second AS INTEGER FTime AS STRING * 8 attribute AS INTEGER Size AS LONG END TYPE TYPE DiskSizeType Drive AS INTEGER TotCl AS LONG AvaCl AS LONG SecCl AS LONG SecSz AS LONG CluSz AS LONG free AS LONG Total AS LONG Used AS LONG END TYPE DECLARE FUNCTION GoodFileName$ (FilName$) DECLARE SUB GetDiskSize (DkSz AS DiskSizeType, UsPath$) DECLARE SUB GetFileData (dta$, File AS FileType) DECLARE SUB KillFile (FilName$, FilAttribute%, Result%) DECLARE SUB findfirstfile (Path$, dta$, Result%) DECLARE SUB FindNextFile (dta$, Result%) DECLARE SUB SetFileAttribute (UsPath$, FilName$, FilAttribute%, Result%) CONST false = 0, true = NOT false, Move = 1, Normal = 2,_ ReadOnly = 4,_ Hidden = 8, Archive = 16, EveryThing = 30, DelFileInt21h = &H4100,_ MoveFilePointerInt21h = &H4200,_ SetDTAInt21h = &H1A00,_ GetDTAInt21h = &H2F00, GetDiskFreeSpaceInt21h = &H3600 DIM RegX AS RegTypeX, File AS FileType, DkSz AS DiskSizeType, _ kf$(200), ka%(1 TO 200) Get2Parm InFile$, OutFile$, UsPath$, Parm% DIM att(5) AS STRING * 1 att(0) = "R": att(1) = "H": att(2) = "S": att(3) = "L": _ att(4) = "D": _ att(5) = "A" findfirstfile FileSpec$, dta$, Result% '>>> Continued Next Message --- timEd/B6 * Origin: Flyer_Proof_Computer_Svs,Richmond_CA,MO,V32B (1:125/411) SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1 SEEN-BY: 153/752 154/40 77 157/2 159/100 125 430 950 203/23 209/209 280/1 SEEN-BY: 390/1 396/1 15 397/2 2230/100 3603/20