Here is a very simple terminal program. I've tested it by calling the
PowerBASIC BBS. I am in the process of adding built-in ANSI support and
Ymodem downloads. I'll then re-post the finished code.
$ERROR ALL ON
$LIB COM ON
$LIB IPRINT ON
$COM 1024
$COMPILE EXE
DEFINT A-Z
COLOR 7, 1 ' Set screen color.
CLS ' clear the screen
Quit$ = CHR$(0,16) ' Value returned by INKEY$
' when ALT+q is pressed.
' Set up prompt on bottom line of screen and turn cursor on
LOCATE 24, 1, 1
PRINT STRING$(80, "-");
LOCATE 25, 1
PRINT TAB(30); "Press ALT+q to quit";
' Print between lines 1 & 23.
VIEW TEXT (1,1)-(80,23)
' Open communications (115200 baud, no parity, 8-bit data,
' 1 stop bit, 1k input buffer):
OPEN "COM2: 115200,N,8,1,DS,CS" AS #1 LEN = 1024
DO
KeyInput$ = INKEY$ ' Check the keyboard.
IF KeyInput$ = Quit$ THEN ' Exit the loop if the user
EXIT DO ' pressed ALT+q.
ELSEIF KeyInput$ "" THEN ' Otherwise, if the user has
PRINT #1, KeyInput$; ' pressed a key, send the
' character typed to modem.
END IF
IF LOC(1) THEN
' LOC(1) gives the number of characters waiting:
ModemInput$ = INPUT$(LOC(1), #1)
PRINT ModemInput$;
END IF
LOOP
' Print between lines 1 & 25.
VIEW TEXT (1,1)-(80,25)
CLOSE ' End communications.
'Reset color and clear screen
COLOR 7,0
CLS
'End Program
END
---
* QMPro 1.53 * Does the Big Bang make a sound if no one hears it?
--- WILDMAIL!/WC v4.12
---------------
* Origin: Toast House * (314) 994-0312 * (1:100/560.0)
|