maelstrm
Experienced Member
Hello Federation,
I'm learning about BBSes (and I even have one online). I want to know if it's possible to create QBASIC applications and have them run interactively as part of my BBS system.
I have:
I've already worked out how to call EXE's and batch files using the BBS software. However, programs written in QBASIC do not work correctly over telnet (though they do work correctly when called from the BBS if you are in front of the PC). It's as if the output needs to be told to redirect back to the serial port. This "works" (aka works across telnet too) if I have a qbasic program with a simple "Hello World" that redirects to COM1, like this:
So I know in theory it should work. But redirecting with ">" isn't going to help with getting input from a user. What I think I need to be able to do is interact directly with COM1 inside of a QBASIC program.
My first attempts were something like this, but of course did not work across a telnet session:
So I tried interacting with the COM port, but still can't seem to get it. Here's my current code:
Note: 9600,N,8,1 are the correct parameters for the serial port on the Lantronix UDS10.
I think this is something simple, just can't figure it out. Any help would be appreciated!
I'm learning about BBSes (and I even have one online). I want to know if it's possible to create QBASIC applications and have them run interactively as part of my BBS system.
I have:
- Waffle BBS
- A Lantronix UDS10
- A working BBS accessible via telnet
I've already worked out how to call EXE's and batch files using the BBS software. However, programs written in QBASIC do not work correctly over telnet (though they do work correctly when called from the BBS if you are in front of the PC). It's as if the output needs to be told to redirect back to the serial port. This "works" (aka works across telnet too) if I have a qbasic program with a simple "Hello World" that redirects to COM1, like this:
C:\myprogs\prog1.exe > COM1
So I know in theory it should work. But redirecting with ">" isn't going to help with getting input from a user. What I think I need to be able to do is interact directly with COM1 inside of a QBASIC program.
My first attempts were something like this, but of course did not work across a telnet session:
INPUT "What is your name"; name$
So I tried interacting with the COM port, but still can't seem to get it. Here's my current code:
When I don't redirect this with >, I don't see any text come across the telnet session, not even the first two PRINT statements (though it does appear on the local screen/console). The telnet user can't see any of the QBASIC program, nor are they able to enter anything. The console user is also unable to enter anything. The system effectively is unable to process any more keyboard input until after a reboot.PRINT "HELLO WORLD"
PRINT "NAME?"
REM Open an input stream with COM1, name it #1:
OPEN "COM1:9600,N,8,1,CD0,CS0,DS0,OP0,RS,TB2048,RB2048" FOR INPUT AS #1
REM Capture the input from #1 and store in the variable name$
INPUT #1, name$
REM Terminate the stream from #1
CLOSE #1
REM Open an output stream with COM1, name it #2:
OPEN "COM1:9600,N,8,1,CD0,CS0,DS0,OP0,RS,TB2048,RB2048" FOR OUTPUT AS #2
REM Print the name$ variable to stream 2:
PRINT #2, name$
Note: 9600,N,8,1 are the correct parameters for the serial port on the Lantronix UDS10.
I think this is something simple, just can't figure it out. Any help would be appreciated!