Microsoft KB Archive/65548

= Microsoft Knowledge Base =

PDS 7.1 Can Now Buffer COM1 or COM2 Input Data During a SHELL
Last reviewed: January 12, 1995

Article ID: Q65548

SUMMARY
In most versions of Microsoft Basic Compiler and QuickBasic, during a SHELL, data coming in through the communications port is not buffered and is lost. A new feature of Microsoft Basic Professional Development System (PDS) version 7.1 allows programs compiled with the BC /O (stand-alone) option to continue to buffer communications input during a SHELL. However, programs that use the run-time module with Basic PDS 7.1 still cannot handle COM1 or COM2 input during a SHELL.

This information applies to Microsoft Basic PDS 7.1 for MS-DOS and MS OS/2. The above feature is not available in the following products: Microsoft QuickBasic versions 4.0, 4.0b, and 4.5 for MS-DOS; Microsoft Basic Compiler versions 6.0 and 6.0b for MS-DOS and MS OS/2; and Microsoft Basic PDS version 7.0 for MS-DOS and MS OS/2.

MORE INFORMATION
This feature is available only when you compile with BC /O. The /O compiler switch causes the program to be completely stand-alone, which means it will run without the run-time module. This feature is not available with the run-time module because the run-time module is taken out of memory during a SHELL and reloaded when the SHELL is exited. Because the code for communications support is contained in the run-time module, it is not available during the SHELL. Therefore, the program cannot continue to buffer the communications data because the code that supports communications has been removed from memory. With a stand-alone program, the code for communications support is directly linked to the program and stays in memory, thus allowing the program to continue to buffer communications data during a SHELL.

Note that Microsoft QuickBasic version 3.0 buffers serial communications during a SHELL for programs compiled with or without the /O option. This behavior is due to a design different than later versions.