Microsoft KB Archive/51076

= PE Option in OPEN COM Statement Enables Parity Checking =

Article ID: 51076

Article Last Modified on 11/21/2006



This article was previously published under Q51076



SUMMARY
When opening a communications port (COM1 or COM2) in Microsoft QuickBasic or Microsoft Basic Compiler, the parity is not checked unless the PE option is specified in the OPEN COM statement.

The PE option must be added under the OPEN COM statement (listed alphabetically under OPEN) in the following Basic language references:
 * 1) The QB Advisor on-line Help system for QuickBasic Version 4.50, under the OPEN COM statement
 * 2) Page 297 of &quot;Microsoft QuickBasic 4.0: Basic Language Reference&quot; manual for Versions 4.00 and 4.00b
 * 3) Page 297 of &quot;Microsoft Basic Compiler 6.0: Basic Language Reference&quot; for Versions 6.00 and 6.00b for MS OS/2 and MS-DOS
 * 4) Page 241 of &quot;Microsoft Basic 7.0: Basic Language Reference&quot; for Microsoft PDS Version 7.00 for MS OS/2 and MS-DOS
 * 5) The Microsoft Advisor on-line Help system for QuickBasic Extended Version 7.00, under the OPEN COM statement.
 * 6) Page 375 of &quot;Microsoft QuickBasic Compiler&quot; Versions 2.0x and 3.00 manual

The PE option is documented in the &quot;Microsoft GW-Basic Interpreter: User's Reference&quot; for Versions 3.20, 3.22, and 3.23, under the OPEN COM statement.



MORE INFORMATION
The PE option enables parity checking during communications. A &quot;Device I/O error&quot; occurs if the two communicating programs have two different parities. (Parity can be even, odd, none, space, or mark). For example, a &quot;Device I/O error&quot; occurs when two programs try to talk to each other across a serial line using the following two different OPEN COM statements: OPEN &quot;COM1:1200,O,7,2,PE&quot; FOR RANDOM AS #1 and OPEN &quot;COM2:1200,E,7,2,PE&quot; FOR RANDOM AS #2 If the PE option is removed from the OPEN COM statements above, no error occurs.

This information applies to Microsoft QuickBasic Versions 1.00, 1.01, 2.00, 2.01, 3.00, 4.00, 4.00b, 4.50, to Microsoft Basic Compiler Versions 6.00 and 6.00b for MS-DOS, and to Microsoft Basic PDS Version 7.00 for MS-DOS.

Additional query words: QuickBas BasicCom

Keywords: KB51076

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.