Running QB64 on Win 7 64-bit.
Having a lot of trouble with opening more than one COM port. To try to get to the bottom of the issue, I'm using the following simple program.
Ports 1 and 8 are valid on my PC. When I enter 1, COM1: is successfully opened -- and presumably closed, as per my close instruction. The program sleeps for 3 seconds to give Windows some time to do the close (although I don't believe that is strictly is necessary).
Thereafter, any attempt to open another port (valid or not) results in Error 64 -- "Bad file name. File name contains illegal characters or exceeds 12 characters" -- neither of which allegation is true.
In fact, it won't even allow me to open port 1 again, after it has been closed. Just error 64 and goodbye.
Got me beat. Could someone please run my sample program in their environment and let me know what you get.
BTW: the open mode -- random or binary -- makes no difference to the result in my environment.
Start:
INPUT "Com Port #: ", Port$
OPEN "COM" + Port$
+ ":4800,N,8,1" FOR RANDOM AS #1 ' open the serial interface PRINT "Opening COM" + Port$
+ ":4800,N,8,1"
ErrorHandler: