[comp.sys.ibm.pc] more than 15 files open at a time

robak@sluga.UUCP (Ted Robak) (09/13/89)

	Does anyone know why a Clipper-compiled program does not allow me to
	open more than 15 files at a time? My config.sys is set up for 25 
	files, and I'm using DOS 3.30. Clipper states that DOS 3.30 should 
	allow me me to open 255 files at a time. I haven't found anything on
	Clipper on-line manual which says that any special compiling, linking
	or configuration commands are required. I use the Borland Turbolinker,
	but even PLINK86+ works no better.
	Please mail answers to me.

	Thanks in advance

	robak@sluga.se

las) (09/14/89)

In article <167@sluga.UUCP> robak@sluga.UUCP (Ted Robak) writes:
>	Does anyone know why a Clipper-compiled program does not allow me to
>	open more than 15 files at a time? My config.sys is set up for 25 
>	files, and I'm using DOS 3.30. Clipper states that DOS 3.30 should 
>	allow me me to open 255 files at a time. I haven't found anything on
>	Clipper on-line manual which says that any special compiling, linking
>	or configuration commands are required. I use the Borland Turbolinker,
>	but even PLINK86+ works no better.

Ha haaa!!!  DOS strikes again.  The config.sys parameter sets the total
number of files which can be open in the system, but an individual
process is normally only allowed a maximum of 20 open files.  You're
only able to open 15 because DOS provides 5 open files to every
process: STDIN, STDOUT, STDERR, STDAUX, STDPRN.  In DOS 3.3, however,
you can change the number of open files for a process using the 
"Set Handle Count" function call.  I know nothing about Clipper, but
if you can issue an interrupt 21 call, you can change the handle count
to any number up to 255.  Strange that Clipper makes that statement
but doesn't appear to support it themselves by making the required
call.

BTW, the function code is 67h with the desired handle count in BX.  In
assembly language:

		MOV	AH,67h
		MOV	BX,<desired handle count>
		INT	21h

In Turbo/Microsoft/Lattice C:

	#include <dos.h>

	function change_handle_count(count)
	int count;
	{
	  struct REGS inregs, outregs;

	  inregs.h.ah = 0x67;
	  inregs.h.bx = count;
	  int86(0x21h, &inregs, &outregs);
	}

Can't help you specifically with Clipper, sorry.

regards, Larry
-- 
Signed: Larry A. Shurr (cbema!las@att.ATT.COM or att!cbema!las)
Clever signature, Wonderful wit, Outdo the others, Be a big hit! - Burma Shave
(With apologies to the real thing.  The above represents my views only.)
(Please note my mailing address.  Mail sent directly to cbnews doesn't make it.)

nfs0294@dsacg1.UUCP (Glendell R. Midkiff) (09/14/89)

From article <9526@cbnews.ATT.COM>, by cbema!las@cbnews.ATT.COM (cbema!las):
> In article <167@sluga.UUCP> robak@sluga.UUCP (Ted Robak) writes:
>>	Does anyone know why a Clipper-compiled program does not allow me to
>>	open more than 15 files at a time? My config.sys is set up for 25 
>>	files, and I'm using DOS 3.30. Clipper states that DOS 3.30 should 
>>	allow me me to open 255 files at a time.


Clipper will use the LESSER of the FILES=XX statement in your config.sys
and the environment variable CLIPPER=FXX.

To open more than 15 files in Clipper, you must use  a statement 
     SET CLIPPER=F31   (Nantucket says this should be ODD number)
in your autoexec.bat or from the DOS command line.
This statement would allow 31 files to be open.  NOTE you must also have
your FILES= statement in config.sys set at 31 or greater.

-- 
 |-----------------------------------------------------------------------|
 |Glen Midkiff   osu-cis!dsacg1!gmidkiff                                 |
 |From the Internet: gmidkiff@dsacg1.dla.mil                             |
 |Phone: (614)-238-9643 @DLA, Systems Automation Center, Columbus, Oh.   |