QBASIC.EXE max 16 files open at once. CONFIG FILES= no help
QBASIC.EXE max 16 files open at once. CONFIG FILES= no help
I'm using QBASIC.EXE with Windows XP. Works very good except for the number of files that can be opened simlulataneously. The max seems to be about 16, after which even the HELP files cannot be found until after I execute the END statement in the immediate pane. So I have set inside C:\WINDOWS\SYSTEM32\CONFIG.NT,
files=400
and rebooted. That does not help. The QBASIC.EXE file is in the C:\OLDDOS directory, and so is the source code .BAS file. I have also tried .PIF and set that "Advanced" CONFIG file to files=( a lot ) and even used
device=c:\windows\system32\ansi.sys
as a test to make sure the CONFIG.SYS and/or CONFIG.NT was actually being read. As confirmation, I use the QBASIC SHELL statement to start a batch file, and inside that batch file are some ansi commands to change character colors, they work fine. But the number of simultaneously open files are still limited to 16 no matter what I do. That's too bad, since QBASIC.EXE works well on XP otherwise, running very fast.
files=400
and rebooted. That does not help. The QBASIC.EXE file is in the C:\OLDDOS directory, and so is the source code .BAS file. I have also tried .PIF and set that "Advanced" CONFIG file to files=( a lot ) and even used
device=c:\windows\system32\ansi.sys
as a test to make sure the CONFIG.SYS and/or CONFIG.NT was actually being read. As confirmation, I use the QBASIC SHELL statement to start a batch file, and inside that batch file are some ansi commands to change character colors, they work fine. But the number of simultaneously open files are still limited to 16 no matter what I do. That's too bad, since QBASIC.EXE works well on XP otherwise, running very fast.
- burger2227
- Veteran
- Posts: 2466
- Joined: Mon Aug 21, 2006 12:40 am
- Location: Pittsburgh, PA
Qbasic is limited as to that number of files you can open. If you can, store your file data in arrays and close those files to get more data.
OR you could use QB64 to run your program. It is a QBasic clone written in C to compile EXE files out of QB code. It also can run on VISTA and Windows 7 even with 64 bit.
The link is in my signature.
Ted
Mod
OR you could use QB64 to run your program. It is a QBasic clone written in C to compile EXE files out of QB code. It also can run on VISTA and Windows 7 even with 64 bit.
The link is in my signature.
Ted
Mod
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
Reply
Thanks. I'm curious though about why QBasic lists "file numbers" 1-255, but does not mention simultaneously open files. Is this because QBASIC was taken from QuickBasic 4.0 or 4.5 and they needed to apply this limitation?
I'm wondering, too. What's the difference between QBASIC 1.0 and 1.1, other than they came with DOS 5 and DOS 6, respectively?
I found QB45 to be interesting. It seems this would be a daunting project, since it would have to be backwards compatible with all the bugs in QBASIC.EXE. By the way, has anyone actually made a list of bugs in QBASIC.EXE ? ?
I'm wondering, too. What's the difference between QBASIC 1.0 and 1.1, other than they came with DOS 5 and DOS 6, respectively?
I found QB45 to be interesting. It seems this would be a daunting project, since it would have to be backwards compatible with all the bugs in QBASIC.EXE. By the way, has anyone actually made a list of bugs in QBASIC.EXE ? ?
- burger2227
- Veteran
- Posts: 2466
- Joined: Mon Aug 21, 2006 12:40 am
- Location: Pittsburgh, PA
There are VAST improvements with each release. EVERYBODY fixes program bugs!
Qbasic was free while Quickbasic cost money because it had a compiler.
QB4.5 is the most popular and is still used by some businesses. However 64 bit and VISTA won't run anything but SCREEN 0 text windows. No fullscreen!
QB64 has many new things added plus it does not have the limitations of memory and such. MOST of the QB keywords are compatible. Only a few need added. I've never heard of anybody running out of files yet! It's free!
Qbasic was free while Quickbasic cost money because it had a compiler.
QB4.5 is the most popular and is still used by some businesses. However 64 bit and VISTA won't run anything but SCREEN 0 text windows. No fullscreen!
QB64 has many new things added plus it does not have the limitations of memory and such. MOST of the QB keywords are compatible. Only a few need added. I've never heard of anybody running out of files yet! It's free!
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
HOW ARE YOU NUMBERING THE FILES THAT YOU OPEN?
ONCE I HAD AN ERROR MESSAGE LIKE "TOO MANY FILES" (OR SOMETHING
SIMILAR), BECAUSE TO OPEN FILES I WAS USING BIGGER NUMBERS.
FOR EXAMPLE I WAS USING:
OPEN "1" FOR INPUT AS 211
OPEN "2" FOR INPUT AS 222
OPEN "3" FOR INPUT AS 233
ETCETERA...
THE QB REALLY WAS BELIEVING I WAS OPENING TOO MANY FILES.
ARE YOU NUMBERING THEM ONE BY ONE WHEN YOU OPEN THEM?
ONCE I HAD AN ERROR MESSAGE LIKE "TOO MANY FILES" (OR SOMETHING
SIMILAR), BECAUSE TO OPEN FILES I WAS USING BIGGER NUMBERS.
FOR EXAMPLE I WAS USING:
OPEN "1" FOR INPUT AS 211
OPEN "2" FOR INPUT AS 222
OPEN "3" FOR INPUT AS 233
ETCETERA...
THE QB REALLY WAS BELIEVING I WAS OPENING TOO MANY FILES.
ARE YOU NUMBERING THEM ONE BY ONE WHEN YOU OPEN THEM?
MY PAGE: http://Qbasic.phatcode.net" target="_blank
(I ONLY USE WINDOWS 98SE YET, BELIEVE IT OR NOT)
(I ONLY USE WINDOWS 98SE YET, BELIEVE IT OR NOT)
Numbering files
I'm numbering them automatically with the built-in FREEFILE function. This function seems to be very good at using the lowest unused number, so the numbers are never higher than necessary. My program scans files. Some lines contain a reference to another file. So rather than closing the first file, I simply open the second file, and when done scanning the second, continue scanning the first from where it left off. But if I were to close the first file, I would have to open it again and invoke the correct number of LINE INPUT #n, a$ commands, which slows the program down considerably. So I leave the files open for this reason. But the second file can have a reference to a third, and so forth. So I was putting a hard limit of 240 files open at once, since QB mentions that the numbers run from 1-255, and MS-DOS (NTVDM) can handle that many files at the same time with the FILES= command in CONFIG. With this program, 16 files open at once would be way too limiting, and I would be much better off using QB64. But I would very much like to find out some rhyme or reason as to why Microsoft likes to entice people by mentioning numbers 1-255, but NOT MENTION a 16 file limit in the "QBasic Environment Limits" section of the help.
- burger2227
- Veteran
- Posts: 2466
- Joined: Mon Aug 21, 2006 12:40 am
- Location: Pittsburgh, PA
They would not have set a limit for Windows if they didn't have to. When a file is opened part of it is loaded to memory for faster access. So even Windows has a limit or it could crash.
I can see no good reason to exceed the 15 file limit in QB as it would use too much memory and crash or slow down. My XP winces when I just open ONE QB program. It dgars when two are opened.
The other day, it would not load a preview window until I closed QB. Even QB64 loads it down a bit. It's a good idea to use sleep in "Press any key" loops too! It allows windows to share the CPU too. QB64 has _LIMIT to slow down loops or use less memory.
Ted
I can see no good reason to exceed the 15 file limit in QB as it would use too much memory and crash or slow down. My XP winces when I just open ONE QB program. It dgars when two are opened.
The other day, it would not load a preview window until I closed QB. Even QB64 loads it down a bit. It's a good idea to use sleep in "Press any key" loops too! It allows windows to share the CPU too. QB64 has _LIMIT to slow down loops or use less memory.
Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
I have Windows XP Home SP3. I have had 24 QBASIC.EXE's running at the same time. Yet I could still open a browser and browse the Internet. All 24 were running a loop waiting for user input. I also had all 24 in edit mode at the same time as well. And they would each respond quickly.
The trick was to use a .PIF to start each one using settings on how fast to recognize no user input. Different .PIF settings dramtically change the speed and response of NTVDM hosted MS-DOS programs like QBASIC.EXE.
Anyway, if QBasic tries to use the small MS-DOS memory for file management, why is QBasic even more restrictive than other MS-DOS programs in this regard? Windows XP itself could probably open upwards of 500 simultaneously without a problem. After all, I do have 489 MB RAM available to Windows.
So I'm wondering if NTVDM (comes free with Windows XP, and is installed by default), uses Windows protected mode to manage MS-DOS files? Or is this all done, including file management using virtual 8086 mode of the processor? I'm not sure.
Why "QBasic Environment Limits" mentions 1-255, but does not warn about a 15 file limit is still quite a mystery, since simultaneosuly open files is very much an environment limit if there ever was one.
As for recursive file scanning, sure there is a way to do this by storing file contents in very large arrays, which definitely would use up just as much memory as all those open files, even more. So in the end, is there a way to do this pattern of recursive file scanning without dramtically slowing down the program?
I'm looking for a QBASIC.EXE solution, since it's bugs are stable and this program is going into an industrial environment.
The trick was to use a .PIF to start each one using settings on how fast to recognize no user input. Different .PIF settings dramtically change the speed and response of NTVDM hosted MS-DOS programs like QBASIC.EXE.
Anyway, if QBasic tries to use the small MS-DOS memory for file management, why is QBasic even more restrictive than other MS-DOS programs in this regard? Windows XP itself could probably open upwards of 500 simultaneously without a problem. After all, I do have 489 MB RAM available to Windows.
So I'm wondering if NTVDM (comes free with Windows XP, and is installed by default), uses Windows protected mode to manage MS-DOS files? Or is this all done, including file management using virtual 8086 mode of the processor? I'm not sure.
Why "QBasic Environment Limits" mentions 1-255, but does not warn about a 15 file limit is still quite a mystery, since simultaneosuly open files is very much an environment limit if there ever was one.
As for recursive file scanning, sure there is a way to do this by storing file contents in very large arrays, which definitely would use up just as much memory as all those open files, even more. So in the end, is there a way to do this pattern of recursive file scanning without dramtically slowing down the program?
I'm looking for a QBASIC.EXE solution, since it's bugs are stable and this program is going into an industrial environment.
Re: QBASIC.EXE max 16 files open at once. CONFIG FILES= no
Although this thread is rather old, I decided that it was worthwhile to post a discovery that I just made about the "too many files" error that can happen when you attempt to build a project.
I have confirmed that the message is misleading, and that the real issue is that the length of the fully qualified name of the source file is too long. You can reproduce the error as follows.
I have confirmed that the message is misleading, and that the real issue is that the length of the fully qualified name of the source file is too long. You can reproduce the error as follows.
- Move or copy your source code to a directory that has a long name, where long means that the total length of the name string is greater than about 56 characters.
- Start the QB editor, instructing it to load your main module and whatever quick libraries you need.
- Attempt to build.
- Share the directory that contains your source code or its immediate parent.
- Use the share to map a drive to the shared directory.
- Make the mapped drive the current working drive.
- CD to the source code directory on the mapped drive.
- Load the program into the editor and proceed as usual.
- burger2227
- Veteran
- Posts: 2466
- Joined: Mon Aug 21, 2006 12:40 am
- Location: Pittsburgh, PA
Re: QBASIC.EXE max 16 files open at once. CONFIG FILES= no
QB cannot use long file or folder names at all. It uses 8.3 naming conventions which require that long file names be called using ~n at the end of the first 8 letters where n is a number, normally 1. Folders are limited to 8 letters and numbers with ~n used for longer names.
QB still cannot open more than 14 or 15 files at one time no matter what they are called or where they are located.
QB still cannot open more than 14 or 15 files at one time no matter what they are called or where they are located.
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
Re: QBASIC.EXE max 16 files open at once. CONFIG FILES= no
Perhaps I didn't explain sufficiently clearly.burger2227 wrote:QB cannot use long file or folder names at all. It uses 8.3 naming conventions which require that long file names be called using ~n at the end of the first 8 letters where n is a number, normally 1. Folders are limited to 8 letters and numbers with ~n used for longer names.
QB still cannot open more than 14 or 15 files at one time no matter what they are called or where they are located.
When you attempt to run a DOS program from a working directory with a long file name, the DOS program will either completely fail or behave strangely. Thankfully, it usually fails outright.
In the case cited here, the name of my working directory was C:\Documents and Settings\DAG\My Documents\Programming\QB4\WWDOSLOG, a string of 67 characters. Although the QuickBASIC integrated development environment started up without issue, selecting the Make EXE option from the Run menu caused a "too many files" error when the dialog box was processed.
Suspecting that the long path was part or all of the problem, I did as follows.
- I shared directory C:\Documents and Settings\DAG\My Documents\Programming\QB4\, naming the share QB4_SRCE.
- I created a mapped drive letter (Z:) from the share, \\ZAPHOD42\QB4_SRCE.
- I changed the current directory to Z:\WWDOSLOG.
- I opened the QuickBASIC editor and successfully built the program.
- burger2227
- Veteran
- Posts: 2466
- Joined: Mon Aug 21, 2006 12:40 am
- Location: Pittsburgh, PA
Re: QBASIC.EXE max 16 files open at once. CONFIG FILES= no
The same thing can happen in other Windows programs. That's probably one reason that they did away with "Documents and Settings" also.
The number of files opened limit is a DOS memory problem, not a folder name problem.
The number of files opened limit is a DOS memory problem, not a folder name problem.
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0