Carrier Detect

 BBS: Inland Empire Archive
Date: 01-29-93 (15:40)             Number: 377
From: ROB MCKEE                    Refer#: NONE
  To: JOHN KELLEY                   Recvd: NO  
Subj: Carrier Detect                 Conf: (2) Quik_Bas
Hello John!
   John Kelley wrote in a message to All:


 JK> Looking for and example of code to monitor carrier detect.
 JK> Would like to be able to have a local programer using
 JK> Thorobred  add carrier detect to his program but he has
 JK> never seen any code as to what to do. I know there has to be
 JK> someone in the Quick Basic world that can do this and
 JK> hopefully we can transfer this to another basic program. Any

FUNCTION CD% ()
    CD%=  (Inp(PortModemStatus%) and &h80) >0  ' This is for COM1 END FUNCTION

I put it in the Keyboard Loop

  CONST COM1% = &h3f8, COM2% = &h2f8, COM3% = &h3e8, COM4%
= &h2e8     PortBaudRateDiv%  = COM% + 1
    PortINTid%        = COM% + 2
    PortLineControl%  = COM% + 3
    PortModemControl% = COM% + 4
    PortLineStatus%   = COM% + 5
    PortModemStatus%  = COM% + 6 ' CD, RI, etc...
    .
    .
    .
    :DoTheKeyThing:
    DO
        StatusLineTime
        If CD%=0 then Err = 255 ' NoCarrier
        i$= IOinkey$(Port%)
    Loop while i$=""
    Return

    :IdleLoop:
    do
        if inp(PortModemStatus%) and &h40 then
            ? "RING - Answering Modem "
            Err = 254 ' Ring
        end if
        StatusScreenWaiting
        Gosub DoTheKeyThing
        select case I$
            case "L","l" ' Local Logon
                Com% = 0
                Err = 240
        end select
    loop

 ' Good Book if you can find it is Compute!'s Mapping the
IBM PC and PCjr.  ISBN 0-942386-92-2 Copyright 1985..  It's
an oldie but one of the BEST books  for the IBM!  Plenty of
GWbasic code also!

 Catcha Later John, I'll see you on the flip side - Rob
 Vote Zack_Jones,Quik_Bas Moderator

--- timEd/B6
 * Origin: Flyer_Proof_Computer_Svs,V32B,V42B,XA (1:125/1212.13)
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