4 Replies - 590 Views - Last Post: 18 October 2013 - 11:58 AM Rate Topic: -----

#1 mature Lady  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 17-October 13

Telephone-Number Word Generator-code for 424-7288="HAIRCUT" I

Posted 18 October 2013 - 09:47 AM

Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
        txtPhoneNumber.Text = "" 'clears textbox
        txtResults.Text = "" 'clears results

    End Sub

    Private Sub btnGenerate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGenerate.Click

        If Not IsNumeric(txtPhoneNumber.Text) Then
            txtPhoneNumber.Text = ""
        Else
            If txtPhoneNumber.Text.Length < 7 Then
                MessageBox.Show("Phone Number Must Be 7 Digits Long")
            Else

                Dim phoneNumber As Integer = Convert.ToInt32(txtPhoneNumber.Text)

                Dim letters(,) As String = {{" ", " ", " "},
                {" ", " ", " "}, {"A", "B", "C"}, {"D", "E", "F"},
                 {"G", "H", "I"}, {"J", "K", "L"}, {"M", "N", "O"},
                {"P", "R", "S"}, {"T", "U", "V"}, {"W", "X", "Y"}}

                Dim digits(6) As Integer
                Dim output As String = String.Empty

                For i = 6 To 0 Step -1
                    digits(i) = phoneNumber Mod 10
                    phoneNumber \= 10
                Next

                For Loop1 = 0 To 2
                    For Loop2 = 0 To 2
                        For loop3 = 0 To 2
                            For loop4 = 0 To 2
                                For loop5 = 0 To 2
                                    For loop6 = 0 To 2
                                        For loop7 = 0 To 2
                                            output &= letters(digits(0), Loop1) &
                                            letters(digits(1), Loop2) &
                                             letters(digits(2), loop3) &
                                            letters(digits(3), loop4) &
                                            letters(digits(4), loop5) &
                                             letters(digits(5), loop6) &
                                            letters(digits(6), loop7)
                                        Next loop7
                                    Next loop6
                                Next loop5
                            Next loop4
                        Next loop3
                    Next Loop2
                Next Loop1

                txtResults.Text = output
            End If
            : End If
    End Sub

    Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click
        Me.Close()
    End Sub


    Private Sub txtPhoneNumber_TextChanged(sender As Object, e As EventArgs) Handles txtPhoneNumber.TextChanged

    End Sub

    ' Private Sub btnRing_Click(sender As Object, e As EventArgs) Handles btnRing.Click
    ' My.Computer.Audio.Play("My.Resources, telephone.wav")


    'End Sub
End Class

This post has been edited by modi123_1: 18 October 2013 - 09:49 AM
Reason for edit:: please use code tags


Is This A Good Question/Topic? 0
  • +

Replies To: Telephone-Number Word Generator-code for 424-7288="HAIRCUT" I

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9072
  • View blog
  • Posts: 34,106
  • Joined: 12-June 08

Re: Telephone-Number Word Generator-code for 424-7288="HAIRCUT" I

Posted 18 October 2013 - 09:49 AM

... is there a question?
Was This Post Helpful? 0
  • +
  • -

#3 astonecipher  Icon User is offline

  • Major DIC Head
  • member icon

Reputation: 617
  • View blog
  • Posts: 2,759
  • Joined: 03-December 12

Re: Telephone-Number Word Generator-code for 424-7288="HAIRCUT" I

Posted 18 October 2013 - 09:51 AM

1. Use code tags looks like

'This is my code



2. What is the problem? Are you getting errors? What does the error say and where is the problematic code?

Just posting code does nothing if you want help.

This post has been edited by astonecipher: 18 October 2013 - 09:52 AM

Was This Post Helpful? 0
  • +
  • -

#4 mature Lady  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 17-October 13

Re: Telephone-Number Word Generator-code for 424-7288="HAIRCUT" I

Posted 18 October 2013 - 10:47 AM

View Postastonecipher, on 18 October 2013 - 09:51 AM, said:

1. Use code tags looks like

'This is my code



2. What is the problem? Are you getting errors? What does the error say and where is the problematic code?

Just posting code does nothing if you want help.

Your code and the code I got off of uTube are almost the same exact code. The one on U-Tube had formatting which I removed because it caused it to go out of range. I am trying to add audio to this where the telephone is ringing and have the numbers = to a name, my homework says 738-2273 = "PETCARE"
trying to figure out the code and put audio to a phone ringing.
Was This Post Helpful? 0
  • +
  • -

#5 astonecipher  Icon User is offline

  • Major DIC Head
  • member icon

Reputation: 617
  • View blog
  • Posts: 2,759
  • Joined: 03-December 12

Re: Telephone-Number Word Generator-code for 424-7288="HAIRCUT" I

Posted 18 October 2013 - 11:58 AM

So, it's like a contact list that plays sounds based on who is calling?
Or does it generate an word from the number entered?

If it is just a contact list that have a csv file that holds the first value as the phone number and the second value as the sound to play. What is the purpose of the for loop?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1