word into array

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vbbb
    New Member
    • Mar 2010
    • 9

    word into array

    Hi,

    How if i want to get

    "word"

    into

    "w"
    "o"
    "r"
    "d"

    in vb6

    Thanks in advance.
  • Kinwang2009
    New Member
    • Feb 2010
    • 22

    #2
    Hi vbbb,
    Here is my best help. In this example you add one TextBox named Text1, one ListBox named List1 and Command Button named Command1 then in the code section copy and paste my below code. Then only thing left for you is to run it and click Command button.

    Private Sub Command1_Click( )
    Dim i As Integer

    For i = 1 To Len(Text1.Text)

    With List1
    .AddItem Mid(Text1.Text, i, 1)
    End With
    Next i
    End Sub
    Hope this helps

    Comment

    • vbbb
      New Member
      • Mar 2010
      • 9

      #3
      Thank you KinWang for your help.

      Comment

      • vbbb
        New Member
        • Mar 2010
        • 9

        #4
        Dim strWord As String
        Dim i As Integer

        strWord = "word"

        For i = 1 To Len(strWord )
        Print Asc(Mid(strWord , i, 1))
        Next i

        Very simple step. Tq KinWang.

        Comment

        • vbbb
          New Member
          • Mar 2010
          • 9

          #5
          How if i want convert number

          2 to be 002 and 23 to be 023

          Thanks

          Comment

          • Kinwang2009
            New Member
            • Feb 2010
            • 22

            #6
            Good that I have solved your problem. For your next question I would suggest you to use the below code.
            Format(Text1.Te xt, "000")
            Hope this helps

            Comment

            • vbbb
              New Member
              • Mar 2010
              • 9

              #7
              Tq KinWang. I really appreciate it.

              Comment

              • vbbb
                New Member
                • Mar 2010
                • 9

                #8
                How if from

                "w"
                "o"
                "r"
                "d"

                to "word". It's return back.

                Comment

                • Kinwang2009
                  New Member
                  • Feb 2010
                  • 22

                  #9
                  Ha ha ha many questions coming from you. Try using below code.
                  Text5.Text = Text1.Text & Text2.Text & Text3.Text & Text4.Text
                  This is the simplest way

                  Thankx

                  Comment

                  • vbbb
                    New Member
                    • Mar 2010
                    • 9

                    #10
                    Tq for your help. I'm beginner for vb6.

                    Comment

                    • vbbb
                      New Member
                      • Mar 2010
                      • 9

                      #11
                      How if from "word" to

                      "w"
                      "wo"
                      "wor"
                      "word"

                      Comment

                      • Kinwang2009
                        New Member
                        • Feb 2010
                        • 22

                        #12
                        Use below code your question.
                        Dim i As Integer

                        strWord = "word"

                        For i = 1 To Len(strWord )
                        Print Asc(Mid(strWord , 1, i))
                        Next i
                        Let us not flood this thread with our question and answers add me to your yahoo messenger as kinwang_12.

                        Thankx

                        Comment

                        • vbbb
                          New Member
                          • Mar 2010
                          • 9

                          #13
                          ok kinwang. i'll add you in ym. tq so much.

                          Comment

                          • Kinwang2009
                            New Member
                            • Feb 2010
                            • 22

                            #14
                            Use below code your question.
                            Dim i As Integer

                            strWord = "word"

                            For i = 1 To Len(strWord )
                            Print Asc(Mid(strWord , i, 1))
                            Next i
                            Let us not flood this thread with our question and answers add my to your yahoo messenger as kinwang_12.

                            Thankx

                            Comment

                            Working...