QB help with disk files?

 BBS: Inland Empire Archive
Date: 04-13-92 (12:23)             Number: 125
From: MATT HART                    Refer#: 64
  To: DONALD SUTER                  Recvd: NO  
Subj: QB help with disk files?       Conf: (2) Quik_Bas
 DS> program it locks up when it tries to
 DS> OPEN the sixteenth file.  My autoexe.bat
 DS> has FILES=50 BUFFERS=30.  Shouldnt
 DS> QB4.5 be able to open more than 15
 DS> files at one time? Is there something

QuickBASIC has the limitation imposed by DOS 2.xx - only 15
files can be opened by any one application at a time.  This
was overcome in DOS 3.xx and up, by a special call must be
made to allow QB to open more than 15 (up to FILES=?? - 5).

' SETHANDL.BAS  Matt Hart
'
' Allow QB to access more than 15 files in DOS 3.3 and up
' See also SETHAND.ASM for assembly version

     '$INCLUDE:'QB.BI'
     DEFINT A-Z

     DIM SHARED InRegs AS RegTypeX
     DIM SHARED OutRegs AS RegTypeX

     NumFiles = 25
     CALL SetHandles(NumFiles)

SUB SetHandles(NumFiles)
     InRegs.AX = &H06700
     InRegs.BX = NumFiles
     CALL InterruptX(&H21,InRegs,OutRegs)
END SUB

; SETHAND.ASM  Matt Hart
;
; Allows QB to access more than 15 files under DOS 3.3 and up
;
; DECLARE SUB SetHandles(NumFiles%)

.MODEL MEDIUM,BASIC
.CODE

SetHandles PROC, NumFiles:Word
    MOV     DI,NumFiles         ; Addr to NumFiles into DI
    MOV     BX,[DI]             ; Value of NumFiles into BX
    MOV     AX,06700h           ; Function 67h into AH
    INT     21h                 ; DOS Interrupt
SetHandles ENDP
END


---
 * Origin: Midnight Micro!  V.32/REL  (918)451-3306 (1:170/600)
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