Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Old Modem Program
#1
Posting an old program from my 2006 backup disk of archived files. I hope someone will find it interesting. 
Code: (Select All)
Cls
Print "Simple Qbasic communications program."
Print "What COM port does your modem use?"
Input ">", port$
baud$ = "9600" '9600 should work fine with most modems. If you have
'an older one use 2400.
'Open up that com port.
Open "COM" + port$ + ":" + baud$ + ",N,8,1,RB2048,TB2048" For Random As #1

Print "OPTIONS:"
Print "1-Dial up to another computer"
Print "2-Wait for a call"
Print "3-Quit"
Do
    a = Val(InKey$)
Loop Until a >= 1 And a <= 3
If a = 3 Then Close: System
If a = 2 Then GoTo waitfor

Print "Number to call?"
Input ">", number$
Print #1, "ATDT" + number$ 'Tell the modem to dial the number.
GoTo chat

waitfor:
Print #1, "ATS0=1" 'Tell modem to connect after 1 ring.

'When a modem connects it returns "CONNECT ####"
'The next hunk of code waits until the modem connects before moving on

a$ = ""
Do
    If Loc(1) Then a$ = a$ + Input$(1, 1) 'if anything in modem add it to a$
Loop Until InStr(a$, "CONNECT") 'Wait until modem have connected.

chat:
'If you where waiting for a call, a lot of ASCII characters will be printed
'on the screen. Don't worry, that's just the computers getting in sync and
'talking. You also will not see what you type.

Cls
Print "You are now ready to chat, press ESC to quit."
Do
    t$ = InKey$
    If Len(t$) Then Print #1, t$ 'if you typed something send it to the modem
    'this will be send by the modem to the other
    'computer
    If Loc(1) Then r$ = Input$(1, 1) 'if the is something to get, get it and save
    'it as r$
    If Len(r$) Then Print r$; 'if r$ <> "" then print it. the ";" means a
    'line is not started
Loop Until t$ = Chr$(27) 'keep doing this until ESC is pressed
Print #1, "ATZ" 'tell the modem to hang up
Close 'close the open com statement
Reply
#2
Cool! I wish I had a modem to test it on.
Reply
#3
Wink 
(04-19-2022, 12:15 PM)Keybone Wrote: Cool! I wish I had a modem to test it on.

Build one!  Smile

https://hackaday.com/tag/acoustic-coupler/

OR

Dirty Build  Smile

https://eric-ode.tripod.com/acoustic_coupler.htm

LOL
Reply
#4
(04-19-2022, 01:12 PM)Abacus Wrote:
(04-19-2022, 12:15 PM)Keybone Wrote: Cool! I wish I had a modem to test it on.

Build one!  Smile

https://hackaday.com/tag/acoustic-coupler/

OR

Dirty Build  Smile

https://eric-ode.tripod.com/acoustic_coupler.htm

LOL

Honestly that would be awesome. lol
Reply
#5
I miss the old days when the modem would screech at you before spending the next 15 minutes downloading an MP3 and all the while hoping that nobody needs to use the phone... 14.4k *sigh*
May your journey be free of incident. Live long and prosper.
Reply
#6
those were painful days, how often the download was 99% complete and then your connection was cut off
Reply
#7
True. So true.
May your journey be free of incident. Live long and prosper.
Reply
#8
(04-19-2022, 09:34 PM)Jack Wrote: those were painful days, how often the download was 99% complete and then your connection was cut off

*70 was a life saver for that situation.
Reply




Users browsing this thread: 1 Guest(s)