Microsoft KB Archive/35667

= OP Parameter Fails to Make OPEN &quot;COM1: &quot; Wait Indefinitely =

Article ID: 35667

Article Last Modified on 11/21/2006

-

APPLIES TO


 * Microsoft QuickBasic 4.0
 * Microsoft QuickBASIC 4.0b
 * Microsoft QuickBasic 4.5 for MS-DOS
 * Microsoft BASIC Compiler 6.0
 * Microsoft BASIC Compiler 6.0b

-



This article was previously published under Q35667



SUMMARY
The manuals listed below incorrectly state that if the OP serial communications parameter is specified without a value, the OPEN COM statement will wait indefinitely for the port to be opened. The OPEN COM statement will actually wait only 10 seconds.

This correction applies to the following manuals on Pages 298 and 299:


 * 1) &quot;Microsoft QuickBasic 4.0: Basic Language Reference&quot; manual for Versions 4.00 and 4.00b
 * 2) &quot;Microsoft Basic Compiler 6.0: Basic Language Reference&quot; for Versions 6.00 and 6.00b for MS OS/2 and MS-DOS

This error also occurs on Page 255 of &quot;Microsoft QuickBasic 4.5: Basic Language Reference&quot; for Version 4.50.

This error has been corrected in the Microsoft Basic PDS Version 7.00 documentation.

Code Examples:
The following program demonstrates that you still get a time-out using the OP parameter: DEFINT A-Z PRINT &quot;wait for open&quot; OPEN &quot;com1:19200,n,8,,OP,rb4048&quot; FOR RANDOM AS #1 PRINT &quot;opened&quot; . . . END As a workaround, you can use the following program, which will wait indefinitely with the error handler returning to the OPEN COM line until it is opened: ON ERROR GOTO check trial = 0 OPEN &quot;com1:9600,n,8,,OP,rb4048&quot; FOR INPUT AS #1 PRINT &quot;opened....&quot; END check: IF ERR = 24 THEN trial = trial + 1 PRINT &quot;open attempt#&quot;; trial RESUME ELSE PRINT &quot;fatal error abort&quot; END END IF

Additional query words: QuickBas BasicCom

Keywords: KB35667

-

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

© Microsoft Corporation. All rights reserved.