Flawless modem terminal

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
Master-of-Mischief
Coder
Posts: 14
Joined: Thu Aug 02, 2007 8:53 pm
Location: USA

Flawless modem terminal

Post by Master-of-Mischief »

Try this out, tell me what ya think. This baby runs pretty smoothe. No LOC commands either or anything fancy.

CLS
A$ = "COM2:2400,N,8,1,CD0,CS0,DS0,OP0,LF,TB2048,RB2048"
OPEN A$ FOR RANDOM AS #1
COM(2) ON

DO
INPUT "", TALK$
IF TALK$ = "" THEN TALK$ = "AT"
IF TALK$ = "EXIT" THEN EXIT DO
IF TALK$ = "CLS" THEN
CLS
K$ = "AT"
END IF
PRINT #1, TALK$
LOCATE CSRLIN - 1, 1

DO
INPUT #1, MODEM$
PRINT MODEM$
IF MODEM$ = "OK" THEN EXIT DO
IF MODEM$ = "ERROR" THEN EXIT DO
IF MODEM$ = TALK$ THEN
IF LEFT$(TALK$, 2) <> "AT" THEN EXIT DO
END IF
LOOP UNTIL INSTR(MODEM$, "NO")
PRINT CHR$(13)

LOOP


COM(2) OFF
CLOSE #1
User avatar
Mentat
Veteran
Posts: 409
Joined: Tue Aug 07, 2007 3:39 pm
Location: NC, US

Post by Mentat »

So... what does it do?
For any grievances posted above, I blame whoever is in charge . . .
Post Reply