* Other [[OPEN]] ''options'' are optional and in any order separated by commas within the OPEN command [[STRING|string]].(See list below)
* The optional FOR access ''mode'' can be [[OUTPUT]], [[INPUT (file mode)|INPUT]] or [[RANDOM]] (default mode when no FOR statement is used).
* '''Currently, QB64 only supports [[OPEN]] FOR [[RANDOM]] access using the [[GET]]/[[PUT]] commands in [[BINARY|BIN]] mode!'''
* '''Use the BIN option listed below for [[BINARY]] byte mode port access!'''
* The [[LEN]] statement is also optional. The default record size is 512 bytes when not used.
* Use the [[LOC]](portnumber) function to determine that there is data in the receive buffer when the value is greater than 0.
* OPEN AS number can use a [[FREEFILE]] value. Numbers used by files already open '''cannot''' be used by OPEN COM!
* [[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keyword Not Supported in Linux or MAC versions]]
<center>'''Qbasic Description NOT Currently supported in QB64!'''</center>
*[[INPUT (file mode)|INPUT]] mode can use [[INPUT (file statement)|INPUT #]] or [[INPUT$]]. [[OUTPUT]] mode can use [[PRINT (file statement)|PRINT #]] or [[PRINT USING (file statement)|PRINT #, USING]].
*[[RANDOM]] or [[BINARY|BIN]] modes can use [[INPUT (file statement)|INPUT #]], [[INPUT$]], [[PRINT (file statement)|PRINT #]], [[GET]] or [[PUT]]. BIN cannot set a buffer size!
* Note: If random use [[LEN]] = to set size of random buffer(default LEN = 128). Use multiples of 128 for larger buffers.
* NOTE: NT or XP computers need a program like [http://www.beyondlogic.org/porttalk/porttalk.htm PortTalk] to access COM or other ports with Qbasic only!
''Example 1:'' Checking to see if a COM port exists. If the port does not exist Qbasic will cause a Windows access error!
{{CodeStart}} '' ''
{{Cl|ON ERROR}} {{Cl|GOTO}} Handler
FF = {{Cl|FREEFILE}}
comPort$ = "COM1:" 'try a COM port number that does not exist
{{Cl|CONST}} comMode$ = "9600,N,8,1,CS0,DS0" 'Use 0 to avoid timeouts