Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I have never been to any technical site that shows concern just to anybody with problems...I look forward to also share in the future..."

Geography

Where in the world do Tek-Tips members come from?

Curious question only.Helpful Member!(2) 

MiggyD (Programmer)
10 Oct 00 11:17
In the QB help files (I have v 4.5), it indicates (moreso...it implies) that the number of data files you can have opened at any one time is 255.

However, I've only been able to access 15 simultaniously.  Example follows:

FOR FileNum=1 TO 30
    MyFile$="trash" + Ltrim$(Str$(FileNum))+".txt"
    OPEN MyFile$ for output as FileNum
    PRINT #FileNum, "This is file #";str$(FileNum)
next FileNum

Any ideas why?  Could it be a typo in the Help file?

I have not yet looked in the MS Knowledge Base, I'm hoping someone here has already found the answer to this curiosity question.

Thanks in advance. -- MiggyD

PS--I've even changed the FILES setting in autoexec.bat but to no avail.




English is too hard to learn, the vowles change too much like come/home, comb/tomb, book/school, high/bye/sty, etc., etc. So should I say Geez or Sheez or Cheeze? hehe.

Helpful Member!  dpaulson (Programmer)
11 Oct 00 21:33
What about in the config.sys?

David Paulson


MiggyD (Programmer)
12 Oct 00 2:56
Oops!  My mistake, I did mean to say the config.sys file.  Have you tried to access more than 15 files simultianeously?

Interesting isn't it?  I'looking through the KB now, hopefuly there's an answer to this riddle.




English is too hard to learn, the vowles change too much like come/home, comb/tomb, book/school, high/bye/sty, etc., etc. So should I say Geez or Sheez or Cheeze? hehe.

Helpful Member!  Alt255 (Programmer)
12 Oct 00 6:06
You know, MiggyD, I thought I could provide an answer this morning. Thought I'd be a wiseguy and whip up a solution using the DOS services.

The only problem is that the solution quit after 7 files were open.

Here's the code, if you want to play with it. Maybe somebody can spot my error....

' $DYNAMIC
DEFINT A-Z
TYPE RegTypeX
        ax      AS INTEGER
        BX      AS INTEGER
        CX      AS INTEGER
        DX      AS INTEGER
        BP      AS INTEGER
        SI      AS INTEGER
        DI      AS INTEGER
        FLAGS   AS INTEGER
        DS      AS LONG
        ES      AS INTEGER
END TYPE
DIM Inregs AS RegTypeX, Outregs AS RegTypeX

REDIM OpenFiles(1 TO 30)

FOR FileNum = 1 TO 30
   MyFile$ = "trash" + LTRIM$(STR$(FileNum)) + ".txt" + CHR$(0)
   Inregs.ax = &H3C00
   Inregs.CX = &H20
   Inregs.DS = VARSEG(MyFile$)
   Inregs.DX = SADD(MyFile$)
   CALL InterruptX(&H21, Inregs, Outregs)   'Create empty file
   hFile = Outregs.ax
   PRINT "Creating:"; hFile
   OpenFiles(FileNum) = hFile
  
   Inregs.ax = &H3D01   '10=read/write
   Inregs.DS = VARSEG(MyFile$)
   Inregs.DX = SADD(MyFile$)
   CALL InterruptX(&H21, Inregs, Outregs)   'Open file
   PRINT "Opening:"; hFile
   
   Inregs.ax = &H4000
   Inregs.BX = hFile
  
   Text$ = "This is file #" + STR$(FileNum)
   Inregs.CX = LEN(Text$)
  
   Inregs.DS = VARSEG(Text$)
   Inregs.DX = SADD(Text$)
   CALL InterruptX(&H21, Inregs, Outregs)   'Write to file
NEXT

FOR FileNum = 1 TO 30
   hFile = OpenFiles(FileNum)
   Inregs.ax = &H3E00
   Inregs.BX = hFile
   CALL InterruptX(&H21, Inregs, Outregs)   'Close each file
NEXT



A plain black box
"Suffice it to say that adding disk drives and a disk operating system to a personal microcomputer is guaranteed to increase its power dramatically."
CP/M and the Personal Computer

dpaulson (Programmer)
12 Oct 00 21:35
I have tried you code. Mine also quits at 15. Dug out my book, blew off dust.  All I could find is that the record number could be between 1 and 255, not how many files you could open at once. I don't know what could restrict this.
Tried code in VB6. Program pukes at 512. Sorry I could be of no help.

David Paulson


MiggyD (Programmer)
13 Oct 00 23:39
I've only gotten about one quarter of the way down the KB without much success either.

As I had originally posted "curiosity" is what drives me to this question.

As for the file number response from dpaulson, I saw that in HELP>CONTENT>LIMITATIONS. (see screen shot below) and as I had mentioned before it seems to imply up to 255.

I guess it is statement that may be understood two different ways.

Thanks Alt255 and dpaulson for at least trying.


   File  Edit  View  Search  Run  Debug  Calls  Options               Help
+------------------ HELP: Limits - Procedures and Files --------------¦+
¦  Limits to QuickBASIC   Files and Procedures   Contents   Index
¦------------------------------------------------------------------------
¦Limits to QuickBASIC - Procedures and Files
¦                                       Maximum                 Minimum
¦Procedure size (interpreted)           65,535 bytes (64 K)     0
¦Number of arguments passed             60 interpreted          0
¦Nesting of include files               5 levels                0
¦Module size (compiled)                 65,535 bytes (64 K)     0
¦Data file numbers                      255                     1
¦Data file record number                2,147,483,647           1
¦Data file record size (bytes)          32,767 bytes (32 K)     1 byte
¦Data file size                         Available disk space    0
¦Path names                             127 characters          1 char
¦Error message numbers                  255                     1
+------------------------------- Untitled ----------------------------¦+




English is too hard to learn, the vowles change too much like come/home, comb/tomb, book/school, high/bye/sty, etc., etc. So should I say Geez or Sheez or Cheeze? hehe.

MiggyD (Programmer)
13 Oct 00 23:50
PS--dpaulson thanks for the info on VB6.  I only have VB4, but it's a good tip none-the-less that I'll have to keep in mind for when VB6 becomes more affordable.

PPS--Alt255, I'm sorry to have you rack your brains on this innocent question.  But thanks for trying an alternative way that I hadn't thought of.

See ya 'round guys! and Thanks again.




English is too hard to learn, the vowles change too much like come/home, comb/tomb, book/school, high/bye/sty, etc., etc. So should I say Geez or Sheez or Cheeze? hehe.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close