increasing file handels in ms basic v7.1 
Author Message
 increasing file handels in ms basic v7.1

I need to increase the number of files I can open in a basic program.  I
searched through the messages and found a reference to do this but I am not
sure how to implement this code.

I did the first part of adjusting the config.sys but the second part I'm not
sure of.

Quote:
>So in a nutshell it goes like this.
>In Config.Sys
>  Set FILES & BUFFERS > the number of open files needed in your program.
>In your program
>   regs.ax = &h6700
>  regs.bx = Number of open files needed + (4-5)
> call interrupt &h21, regs, regs
>check regs.ax to see if successful.

Any help would be appreciated

Thanks
Steve



Mon, 28 Jun 2004 00:08:52 GMT  
 increasing file handels in ms basic v7.1
Here is code I got from Ethan Winer (I think):

DefInt A-Z

Rem $INCLUDE: 'QBX.BI'
Dim Registers As RegType

Dim x(150)
FLim = Val(Command$)
If FLim = 0 Then FLim = 15

Cls

If FLim > 15 Then
        Print SETMEM(-1000)
        Registers.AX = &H6700
        Registers.BX = FLim + 5
        Interrupt &H21, Registers, Registers
        Print SETMEM(1000)
        While INKEY$ = "": Wend: Print
End If

For i = 1 To FLim
        x(i) = FreeFile
        Open "TT" + LTrim$(Str$(x(i))) For Random As x(i)
        Print x(i)
Next
Close
End

To run it in QBX use /L QBX on the command line.  When you link, add the QBX
library.
HTH,
Brad Kunkel

Quote:

> I need to increase the number of files I can open in a basic program.  I
> searched through the messages and found a reference to do this but I am not
> sure how to implement this code.

> I did the first part of adjusting the config.sys but the second part I'm not
> sure of.

> >So in a nutshell it goes like this.
> >In Config.Sys

> >  Set FILES & BUFFERS > the number of open files needed in your program.
> >In your program
> >   regs.ax = &h6700
> >  regs.bx = Number of open files needed + (4-5)
> > call interrupt &h21, regs, regs
> >check regs.ax to see if successful.

> Any help would be appreciated

> Thanks
> Steve



Mon, 28 Jun 2004 02:42:04 GMT  
 increasing file handels in ms basic v7.1


Quote:
> DefInt A-Z

> Rem $INCLUDE: 'QBX.BI'
> Dim Registers As RegType

Experience by myself but in QuickBASIC 4.5 (and also in QBasic 1.1): The
maximum of simultaneously opened files is 16. You even cannot increase it
with a line

FILES=100

in your C:\CONFIG.SYS file. The old GWBASIC.EXE had the "/F" switch to
determine the number of file handles but you paid more file handles with a
decreased program/variable memory.

           Andreas



Mon, 28 Jun 2004 03:41:09 GMT  
 increasing file handels in ms basic v7.1

Quote:
> I need to increase the number of files I can open in a basic program....

Just on principle, I disagree. MS-BASICs give you 15 open files, less four
for the system's use, leaving you 11.

There is no reason to leave that many files open at one time.

I can forgive this if you are modifying an existing program by adding one or
two files to it and rewriting the program to require fewer handles would be
a major undertaking; but if you are designing a system or subsystem from
scratch, I suggest you reconsider your approach.

MCM



Mon, 28 Jun 2004 06:18:44 GMT  
 increasing file handels in ms basic v7.1

Quote:


> > I need to increase the number of files I can open in a basic program....

> Just on principle, I disagree. MS-BASICs give you 15 open files, less four
> for the system's use, leaving you 11.

> There is no reason to leave that many files open at one time.

I've done this, and for good reason...

We use Btrieve for our data file handling, and while most of the time, it is
not necessary to have that many files open, there are circumstances where it
is absolutely necessary.

In my example, we use the transaction processing of Btrieve, where you start
a transaction, and perform operations on one or more files, then commit the
entire transaction, or abort if an error occurs anywhere in between which
rolls-back all the changes.

An example of where this is necessary is a "supplier code changer" in our
accounts payable.  Since the supplier code is in the supplier master file,
the invoice file, the requisitions file, the budgets file, up to ten
different check registers, etc., the code would need to be changed in ALL
files, and if it fails in any one of them, the whole thing needs to abort.
In order for transaction processing to work, all the files need to be open
at the start.

I've used this interrupt myself to set higher file handles, and it works.

--
Bill Hileman, MCP, CPP, BCIP
Programmer/Analyst, DASI

Yahoo! Club for Certaholics
http://clubs.yahoo.com/clubs/certaholics

Computer Language Comparison
http://www.boneville.net/programming/default.htm



Mon, 28 Jun 2004 21:49:22 GMT  
 increasing file handels in ms basic v7.1

Quote:

>Just on principle, I disagree. MS-BASICs give you 15 open files, less four
>for the system's use, leaving you 11.

Most versions of DOS allow for up to 15 files simultaneously open by
default.   11 would be non-standard number.

That is, by default, DOS takes 4 or 5 handles for the standard
devices, leaving 15 available for DOS applications.

Quote:
>There is no reason to leave that many files open at one time.

That is a poor generalization IMO.  There are all kinds of reasons,
but in my experience, the prime reason is usually for performance --
avoiding the overhead of sucessive open/close operations on one or
more files..

YMMV.

Lance
powerbasic Support

-------------------------------------------------------------------------
PowerBASIC, Inc.      | 800-780-7707 Sales | "We put the Power in Basic!"
316 Mid Valley Center | 831-659-8000 Voice | http://www.powerbasic.com



Mon, 28 Jun 2004 23:57:04 GMT  
 increasing file handels in ms basic v7.1
That is not a fair statement to make without knowing the application.
I've written a few programs that leave quite a number of files open.
Primaraly when doing very high speed data aquisition being collected
from 20-30 inputs.  The program keeps the files open because to open
and close the files takes a considerable amount of time.  Another method
is to collect the data in memory then write it to disk when the test is
done.  That works as long as you have enough memory to hold all data
being collected.  There are many reasons to hold numerous handles open.
Quote:

> There is no reason to leave that many files open at one time.

> I can forgive this if you are modifying an existing program by adding one or
> two files to it and rewriting the program to require fewer handles would be
> a major undertaking; but if you are designing a system or subsystem from
> scratch, I suggest you reconsider your approach.

> MCM



Tue, 29 Jun 2004 06:58:36 GMT  
 increasing file handels in ms basic v7.1
On Wed, 09 Jan 2002 22:18:44 GMT, "Michael Mattias"

Quote:



>> I need to increase the number of files I can open in a basic program....

>Just on principle, I disagree. MS-BASICs give you 15 open files, less four
>for the system's use, leaving you 11.

>There is no reason to leave that many files open at one time.

Comparing 16 large text files at once? (which I have had to do)

Quote:

>I can forgive this if you are modifying an existing program by adding one or
>two files to it and rewriting the program to require fewer handles would be
>a major undertaking; but if you are designing a system or subsystem from
>scratch, I suggest you reconsider your approach.

>MCM

--
Arargh (at arargh dot com)    http://www.arargh.com


Tue, 29 Jun 2004 08:50:43 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. MS BASIC PDS v7.10 File Read Problem

2. MS Basic Compiler V7.10 and /MBF option on Win/NT

3. Crystal Reports V7.0, VB V6.0, SQL Server V7.0

4. Stored Procedures - Crystal Report (v5) Infomix (v7.2*) MS v3.11

5. VB Pro v3.0 and MS ACCESS for Win 95 v7.0 - Need Help

6. Crystal V7 or V8 and MS SQL server

7. WANTED: Quick BASIC v7.1

8. WANTED: Quick BASIC v7.1

9. Using Interrupts with Microsoft BASIC v7.1

10. Importing Microsoft Access v7.0 to Visual Basic?

11. Help - MS Access Size Increased!

12. Problems passing Device Context handels from VB 4.0 to VC++2.0 DLL’s

 

 
Powered by phpBB® Forum Software