VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Modem Thing

by Jake McCurry (2 Submissions)
Category: Complete Applications
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Date Added: Wed 3rd February 2021
Rating: (8 Votes)

It turns your modem on and off an amount of times that you define. Good for
annoying someone on the phone that is pissing you off!

Side Effects
It might be possible that this could hurt your modem. I have done this 6000 times before and it didn't affect it any...

Rate Modem Thing

'make a command button name Command1 make its caption "Begin"
'make a Textbox name Textbox1
'make a timer called Timer1 and make it unenabled interval = 500
'make a timer called Timer2 and make its interval 455
'Make a label called Label1

Private Sub Command1_Click()
Do Until Label1.Caption = Text1.Text
Timer1.Enabled = True
PhoneNumber$ = "123-4567" 'isn't important never dials
Open "COM2:" For Output As #1 'or COM1
Print #1, "ATDT" & PhoneNumber$ & Chr$(13)
Label1.Caption = Label1.Caption + 1
Close #1
Loop
End Sub
Private Sub Form_Resize()
On Error GoTo a
Form1.Height = 2715
Form1.Width = 3690
'another good way to do this is makes form1.borderstyle = 1
a:
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
  Case vbKeyReturn:
    Do Until Label1.Caption = Text1.Text
    Timer1.Enabled = True
    PhoneNumber$ = "123-4567" 'this number isn't important it never dials!
    Open "COM2:" For Output As #1 'or COM1
    Print #1, "ATDT" & PhoneNumber$ & Chr$(13)
    Label1.Caption = Label1.Caption + 1
    Close #1
        Loop
  End Select
End Sub
Private Sub Timer1_Timer()
If Label1.Caption = Text1.Text Then
Label1.Caption = "0"
End If
End Sub
Private Sub Timer2_Timer()
  Dim a
a = Int(Rnd * 15) + 1
Text1.ForeColor = QBColor(a)
End Sub

Download this snippet    Add to My Saved Code

Modem Thing Comments

No comments have been posted about Modem Thing. Why not be the first to post a comment about Modem Thing.

Post your comment

Subject:
Message:
0/1000 characters