01-23-2024, 04:53 PM
In my quest to port my QB45 code over to QB64, I am finding things are not 100% portable. Okay, but I'm plugging along trying to learn them. Anyway, my latest is an issue in inputting ASCII text from a COM port. The text would be from 1 to 12 characters followed by the 'enter' key getting pressed. Elsewhere in the program I have used the command 'Open "COM5:9600,N,8,1,RS0,CS0,DS0,CD0" For Random As #1' to handle COM port communications. But for this case, I get a 'Bad File Mode' error for the 'Line Input #1, FILENAME$' command.
If I change the 'Random' to 'Input' I then get the 'Input Past End' error; even though I have not typed a single thing in to send over the comm port. I have tried doing a straight Input #1, and a Get #1, still with errors right off the bat without sending any data. I'm at yet another loss as to what I am missing.....
DEL1: 'Request file deletion COM5
Close #1
Open "COM5:9600,N,8,1,RS0,CS0,DS0,CD0" For Input As #1
Line Input #1, FILENAME$
KILL1$ = "E:\SERVER\CPM\" + KILLFILE$
Kill KILL1$
Put #1, , EOT$
STATLINE$ = Date$ + " - " + Time$ + " - COM5 File Delete Request"
GoSub EVENTSAVE
GoSub PRINTSTAT
Return
If I change the 'Random' to 'Input' I then get the 'Input Past End' error; even though I have not typed a single thing in to send over the comm port. I have tried doing a straight Input #1, and a Get #1, still with errors right off the bat without sending any data. I'm at yet another loss as to what I am missing.....
DEL1: 'Request file deletion COM5
Close #1
Open "COM5:9600,N,8,1,RS0,CS0,DS0,CD0" For Input As #1
Line Input #1, FILENAME$
KILL1$ = "E:\SERVER\CPM\" + KILLFILE$
Kill KILL1$
Put #1, , EOT$
STATLINE$ = Date$ + " - " + Time$ + " - COM5 File Delete Request"
GoSub EVENTSAVE
GoSub PRINTSTAT
Return