Quickbasic Communications

 BBS: Inland Empire Archive
Date: 03-09-92 (14:22)             Number: 111
From: JEAN CREPEAU                 Refer#: NONE
  To: JIM COYLE                     Recvd: NO  
Subj: Quickbasic Communications      Conf: (11) Quik_Bas

In a message to ALL, JIM COYLE wrote: JC=>there... Can anybody give me a working runtine? Also, I was also wondering if anybody knew of a runtine that would display a file and allow the user to abort it (say maybe the space bar) I WAS opening the defint a-z sub display(filnam$) a=freefile open filnam$ for input as #a do while not eof(a) line input #a,x$:print x$ if inkey$=" " then exit do loop close #a end sub if you intend to use that sub in a comm program, use this modified version: defint a-z sub disp2comm(filnam$,commfile) dim incom$ as string*1 crlf$=chr$(13)+chr$(10) a=freefile open filnam$ for input as #a do while not eof(a) if not eof(commfile) then if instr(input$(loc(commfile),#commfile)," ") then exit do endif endif line input #a,x$ put #commfile,,x$ put #commfile,,crlf$ loop close #a end sub When you call disp2comm, you must specify the file number of an open COM buffer for random access. For your answering program, I suggest you to put your modem in AUTO-ANSWER and wait for the string CONNECT. It's easier to do. Try this: defint a-z function connect(commfile) crlf$=chr$(13)+chr$(10) x$="aths0=1"+crlf$:put #commfile,,x$ x$="" do if not eof(commfile) then x$=x$+ucase$(input$(loc(commfile),#commfile)) endif i=instr(x$,"connect"):if i and instr(i,x$,chr$(10)) then exit do i=instr(x$,chr$(10)):if i then x$=mid$(x$,i+1):i=0 loop until inkey$=chr$(27) if i then spd=val(mid$(x$,i+8)) else spd=-1 connect=spd end function This subroutine sends an auto-answer command to your modem, waits for the string "CONNECT" and then get the connection rate. If the rate is 0, that means your modem didn't specify at what speed the connection is. Usually this means 300 bauds. The operator can stop this loop by pressing <Esc> at anytime. The function then returns -1 as the connect rate. --- * Origin: INTERACESS Montreal (QC) Canada (514) 528-1415 (1:167/280)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET