Dial.bas 2/3

 BBS: Inland Empire Archive
Date: 04-12-93 (18:23)             Number: 362
From: SEAN SULLIVAN                Refer#: NONE
  To: ROBERT SCHOENFELD             Recvd: NO  
Subj: Dial.bas 2/3                   Conf: (2) Quik_Bas
'>>> Start of page 2 of DIAL.BAS

          PRINT CHR$(a%);
     ELSE
          BEEP
          markit% = -1                      'Flag set for marking number
     END IF
 END SELECT
 LOCATE , , 1                   'Keep cursor flashing
LOOP
'======================================================================

         'Get the phone number off the screen
Getnum row%, Col%, count%, Port%

         'Restore old vectors
CLOSE 1
  DEF SEG = 0
     POKE &H400, OldPort1H
     POKE &H401, OldPort1L
     POKE &H402, OldPort2H
     POKE &H403, OldPort2L
  DEF SEG
END

SUB Getnum (row%, Col%, markit%, Port%)
IF row% < 1 THEN row% = 1: IF Col% < 1 THEN Col% = 1
LOCATE row%, Col%
FOR x% = 0 TO markit%           'Read the phone number off the screen
     a% = SCREEN(row%, Col% + x%)
     Dialstr$ = Dialstr$ + CHR$(a%)
NEXT x%
LOCATE 23, 25
PRINT "Dialing : "; Dialstr$;
LOCATE 25, 1
PRINT "             Pickup handset and then press space or ESC phone"+ _
" rings      ";
COLOR 7, 0

Setup Port%
PRINT #1, "ATM1DT" + Dialstr$     'Dial the numbar

DO
     b$ = INKEY$
     IF b$ = " " THEN
          Hangup Port%
          EXIT DO
     END IF
     IF b$ = CHR$(27) THEN
          Hangup Port%
          EXIT DO
     END IF
LOOP

END SUB

SUB Hangup (Port%)

PRINT "...Disconnecting 1";
SELECT CASE Port%                'Drop DTR
    CASE 1
        OUT &H3FC, (INP(&H3FC) AND 252)   'com1
    CASE 2
        OUT &H2FC, (INP(&H2FC) AND 252)   'com2
    CASE 3
        OUT &H3FC, (INP(&H3FC) AND 252)   'com3
    CASE 4
        OUT &H2FC, (INP(&H2FC) AND 252)   'com4
END SELECT
     PRINT "...2...";
     PRINT #1, "+++";   'Switch to modem command mode
     SLEEP 1
     PRINT #1, "ATH"    'Send hangup command
     PRINT "...CLICK";

END SUB

SUB Setup (Port%)
'Sets up the comport by swapping the address fo com4 with com2 and
'com3 with com1 if necessary
DEF SEG = 0
 POKE &H400, &HF8
 POKE &H401, 3
 POKE &H402, &HF8
 POKE &H403, 2

SELECT CASE Port%
     CASE 1
        Start$ = "COM1:2400,N,8,1,DS0"
     CASE 2
        Start$ = "COM2:2400,N,8,1,DS0"
     CASE 3
        POKE &H400, &HE8   'For com1 to com3
        POKE &H401, &H3

'>>> Continued on page 3.

--- GoldED 2.40.P0623
 * Origin: COMNET Point #28 [Watervliet, NY] (1:267/113.28)
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