Registrations are now open. Join us today!
There is still a lot of work to do on the wiki yet! More information about editing can be found here.
Already have an account?

Microsoft KB Archive/37347

From BetaArchive Wiki
Knowledge Base

"Device Unavailable" on OPEN "COM1: " Compiled with BC /O/S

Article ID: 37347

Article Last Modified on 11/21/2006

This article was previously published under Q37347


A program that accesses the serial communications ports with OPEN "COM1:" or "COM2:" produces a "Device Unavailable" (run-time error 68) message if it is compiled using BC.EXE with the /O (stand-alone .EXE) and /S (minimize string space) options together.

To work around this limitation, do not use the /S and /O options together when compiling programs that access the communications ports.


Microsoft has confirmed this to be a bug in Microsoft QuickBasic 4.00, 4.00b, and 4.50 for MS-DOS and in Microsoft Basic Compiler 6.00 and 6.00b (buglist6.00 buglist6.00b) for MS-DOS and MS OS/2. We are researching this problem and will post new information here as it becomes available. This problem does not occur in Microsoft Basic PDS Version 7.00 for MS-DOS and MS OS/2 (fixlist7.00).


The sample program below runs properly inside the environment; however, when compiled to an .EXE file using the BC /O and /S options, a "Device Unavailable" error message is produced on the OPEN "COM1:" statement. [The problem can also occur when you use the ON COM(n) GOSUB statement.]

The following is a code example:


Additional query words: QuickBas BasicCom B_BasicCom buglist4.00 buglist4.00b buglist4.50

Keywords: KB37347