MID function in Visual Basic 6.0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • akaaryan
    New Member
    • Feb 2008
    • 2

    MID function in Visual Basic 6.0

    hello friends....

    please help me out on this.........i write ma hole question with explaination . .... . . please tell me the solution . . . .thank u/......


    i hv one textbox with value = "alkim25plt r"

    now i have to write this word in second textbox(text2) . . . . . .with only
    first 5 letters in this second textbox(text2) . . . . . . . .


    then next 2 wrods in textbox3 . . . . . .

    then last 4 words in textbox4 . . . . . . . . . . . .



    please give me the full code of this question . . .. .on my E-Mail ID : E-mail address removed


    please help me out . . . . . .thanks
    Last edited by Killer42; Feb 21 '08, 01:57 AM. Reason: Remove e-mail address as per site guidelines
  • QVeen72
    Recognized Expert Top Contributor
    • Oct 2006
    • 1445

    #2
    Hi,

    Did you Try to use Left() and Mid() Functions...?

    Regards
    Veena

    Comment

    • jamesd0142
      Contributor
      • Sep 2007
      • 471

      #3
      [code=text]
      dim abc as string
      abc = mid(textbox1.te xt,1,5)
      [/code]
      Clearly this will give you the first five characters in textbox1.

      1 stands for the start possition
      5 stands for the length

      Comment

      • akaaryan
        New Member
        • Feb 2008
        • 2

        #4
        Originally posted by jamesd0142
        [code=text]
        dim abc as string
        abc = mid(textbox1.te xt,1,5)
        [/code]
        Clearly this will give you the first five characters in textbox1.

        1 stands for the start possition
        5 stands for the length


        ya i know that....bt u didn't understand ma query ......
        i scaned one string in one textbox like "KFA20LJKJK ". .. . then i want fitst 5 char in second textbox2....... then next......then next.......plz help me out its very important. .. . if possible write full code...so i can understand. . .. .

        Comment

        • mafaisal
          New Member
          • Sep 2007
          • 142

          #5
          Hello,
          Try To Use Left, Right, mid fns

          eg,

          Code:
          Text1.Text = "alkim25pltr"
          Text2.Text = left(Text1.Text,5)
          Text3.Text = mid(Text1.Text,5,7)
          text4.text = right(Text1.Text,7)
          Try like this

          Faisal

          Originally posted by akaaryan
          hello friends....

          please help me out on this.........i write ma hole question with explaination . .... . . please tell me the solution . . . .thank u/......


          i hv one textbox with value = "alkim25plt r"

          now i have to write this word in second textbox(text2) . . . . . .with only
          first 5 letters in this second textbox(text2) . . . . . . . .


          then next 2 wrods in textbox3 . . . . . .

          then last 4 words in textbox4 . . . . . . . . . . . .



          please give me the full code of this question . . .. .on my E-Mail ID : E-mail address removed


          please help me out . . . . . .thanks
          Last edited by Killer42; Feb 21 '08, 01:58 AM. Reason: Remove e-mail address as per site guidelines

          Comment

          Working...