Help on Com ports!!!

 BBS: Inland Empire Archive
Date: 04-09-93 (10:26)             Number: 332
From: KELLY STEELE                 Refer#: NONE
  To: ALL                           Recvd: NO  
Subj: Help on Com ports!!!           Conf: (2) Quik_Bas
Howdy all,

I'm having trouble with the following code.  I can't seem to get it to
open the modem on COM3:.  After exiting the loop, it just hangs at the
"DEF SEG = 0" line.  (At least that's what QB4.5 says when I
Control+Break.)  I even compiled it and tried it outside of the QB4.5
environment.  Any help would be extremely appreciated!!!

=========================> Cut here <=========================


byte1% = PEEK(&H400)   'Save old info
byte2% = PEEK(&H401)   'Save old info
byte3% = PEEK(&H404)   'Get current COM3 info
byte4% = PEEK(&H405)   'Get current COM3 info

POKE &H400, byte3%     'Stuff COM3 base address into COM1
POKE &H401, byte4%     'Stuff COM3 base address into COM1

'  Put your code here
PRINT "Opening COM3:"
OPEN "COM1:2400,N,8,1" FOR RANDOM AS #1 LEN = 256
PRINT "Calling 555-1212"
PRINT #1, "ATDT 555-1212"
PRINT "Waiting for keystroke..."
PRINT "Returning base addresses to normal."

DEF SEG = 0          'Hangs up here

POKE &H400, byte1%   'Reset old COM1 base address
POKE &H401, byte2%   'Reser old COM1 base address


=========================> Cut Here <=========================

 * SLMR 2.1 * If 7-11's are open 24hrs, why put locks on then doors?

--- WM v2.08/91-0012
 * Origin: Com-Dat BBS  Hillsboro, OR.  HST (503) 681-0543 (1:105/314)
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