BBS: Inland Empire Archive
Date: 01-31-93 (23:18)             Number: 379
From: ROB MCKEE                    Refer#: NONE
  To: JOHN GALLAS                   Recvd: NO  
Subj: CARRIER DETECT                 Conf: (2) Quik_Bas
Hello John!
   You wrote in a message to John Kelley:

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

 JG> Use this function to monitor the carrier:

 JG> FUNCTION Carrier  'returns false if no carrier

 JG> BaseAddress = &H3F8  '&H2F8 for com 2

  Not Needed -->  DEF SEG = &H40
 JG> Carrier = ((INP(BaseAddress + 6) AND 128) >= &H80)

    Next Line does the same thing..
 Carrier = (INP(BaseAddress + 6) AND &h80) > 0
  Not Needed -->  DEF SEG


 FUNCTION Carrier(Port) ' returns false (0) if no carrier
 Select Case Port
    CASE 1: BaseAddress = &H3F8
    case 2: BaseAddress = &H2F8
    CASE 3: BaseAddress = &H3E8
    CASE 4: BaseAddress = &H2E8
    CASE ELSE: BaseAddress  = Port
            'For Those PS/2 types out there or Weird ones
 End Select
 Carrier = (INP(BaseAddress + 6) AND &h80) > 0

 Catcha Later , I'll see you on the flip side - Rob

--- 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