serial-portqbasic

Opening a COM port in QBasic on Windows 7


I'm having difficulty opening a COM port in QBasic (obtained from www.qbasic.net) like so

OPEN "COM4:9600,N,8,1,BIN" FOR OUTPUT AS #1

However when I execute this statement in QBasic the open keyword is highlighted and I get the error message Bad file name.


Solution

  • The following works FreeBasic

    Open Com "COM1:9600,N,8,1" As 1
    

    I recommend the FreeBasic IDE FBIde.