Microsoft KB Archive/64108

= GET from COM1 or COM2 Fails to Get Correct Data -- Use INPUT$ =

Article ID: 64108

Article Last Modified on 10/20/2003

-

APPLIES TO


 * Microsoft BASIC Professional Development System 7.0
 * Microsoft BASIC Professional Development System 7.1

-



This article was previously published under Q64108



SYMPTOMS
The GET statement fails to read the correct information from a communications port (COM1, COM2) with Microsoft Basic Professional Development System (PDS) version 7.00. Characters are removed from the buffer, but the values read in are not the correct values sent across the port.



WORKAROUND
To work around this problem, use the INPUT$ function to read the data from the COM port.



STATUS
Microsoft has confirmed this to be a bug in Microsoft Basic PDS versions 7.00 and 7.10 for MS-DOS and OS/2. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

This problem does NOT occur in Microsoft QuickBasic version 4.50 or earlier or in Microsoft Basic Compiler version 6.00b or earlier.



Code Example
The following program attempts to read characters from COM1 using both GET and INPUT$: DIM a AS STRING * 1, b AS STRING * 1 OPEN &quot;COM1:300,n,8,1&quot; FOR RANDOM AS #1 GET #1,, a  b = INPUT$(1, 1) PRINT a, b  END In QuickBasic version 4.50, both the GET and INPUT$ statements return the correct values, but in Basic PDS versions 7.00 and 7.10, only INPUT$ returns the correct data while GET returns meaningless data.

Additional query words: BasicCom SR# S900710-87 buglist7.00 buglist7.10

Keywords: KB64108

-

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

© Microsoft Corporation. All rights reserved.