문제

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.

도움이 되었습니까?

해결책 2

The following works FreeBasic

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

I recommend the FreeBasic IDE FBIde.

다른 팁

Is Com4: one of the available serial ports? Look in control panel and make it is one of the available ports. Also, you must make sure no other programs have the port open.

"COM4:9600,N,8,1,BIN"

The semantics for opening files changed in Win2K. On NTFS, the colon indicates an Alternate Data Stream, and the DOS use of the colon when opening serial devices was not implemented.

So on Win7, "COM4:9600,N,8,1,BIN" is a bad filename.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top