Microsoft KB Archive/33087

= Losing Characters with COM1: Communications in Macintosh BASIC =

Article ID: 33087

Article Last Modified on 11/21/2006

-

APPLIES TO


 * Microsoft QuickBasic 1.0
 * Microsoft BASIC Compiler 6.0b
 * Microsoft BASIC Interpreter 2.0
 * Microsoft BASIC Interpreter 2.1 for Macintosh
 * Microsoft BASIC Interpreter 3.0 for Macintosh

-



This article was previously published under Q33087



SUMMARY
Macintosh BASIC cannot detect input buffer overrun when receiving input from the COM1: communications device. As a consequence, at 1200 baud and faster, it is possible to lose input characters. The following are some methods to alleviate the problem of losing characters at 1200 baud or faster:

 Use a baud rate of 300. Increase the buffer size using the LEN=file-buffer-size argument in the OPEN COM1: statement. Do not perform much screen input and output while receiving input from the COM1: communications device. Make your program code as fast as possible in-between inputs from the COM1: communications device. The following should be done to increase the speed of the code:

 Use the DrawText library routine instead of the PRINT statement. DrawText is faster than PRINT because it sends out one string of characters at a time instead of one character at a time. (DrawText is not supported with Microsoft BASIC Interpreter Versions 2.00 and 2.10.) Use textmode 0 (COPY mode). It can increase text display speed by up to 20 percent compared to other textmodes. Use the SELECT CASE statement instead of doing a series of IF THEN ELSE statements to increase the speed of the code. (SELECT CASE is not supported in the Microsoft BASIC Interpreter Versions 1.x, 2.00, 2.10, or 3.00, but is supported in the QuickBASIC Version 1.00 interpreter and compiler, and in BASIC compiler Version 1.00 for Macintosh.)</li></ol> </li></ol>

An example communications program called TERMINAL is provided on the release disk for BASIC interpreter, compiler, and QuickBASIC for the Macintosh.

Additional query words: BasicCom MQuickB

Keywords: KB33087

-

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

© Microsoft Corporation. All rights reserved.