QB64 Phoenix Edition
Old Modem Program - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1)
+--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3)
+---- Forum: Programs (https://qb64phoenix.com/forum/forumdisplay.php?fid=7)
+---- Thread: Old Modem Program (/showthread.php?tid=43)



Old Modem Program - Abacus - 04-19-2022

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



RE: Old Modem Program - Keybone - 04-19-2022

Cool! I wish I had a modem to test it on.


RE: Old Modem Program - Abacus - 04-19-2022

(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


RE: Old Modem Program - Keybone - 04-19-2022

(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


RE: Old Modem Program - johnno56 - 04-19-2022

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*


RE: Old Modem Program - Jack - 04-19-2022

those were painful days, how often the download was 99% complete and then your connection was cut off


RE: Old Modem Program - johnno56 - 04-19-2022

True. So true.


RE: Old Modem Program - Keybone - 04-20-2022

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