sorting data

Author Message
nor5616

  • Total Posts : 1
  • Scores: 0
  • Reward points : 0
  • Joined: 8/24/2010
  • Status: offline
sorting data Tuesday, August 24, 2010 9:16 PM (permalink)
0
hi, i am new to VB6. i have found the code that use split function as a mark to split the string.The code is shown below: Private Sub Command1_Click() Dim txt As String Dim y As Variant Dim i As Long txt = "apple,10,13,yellow,10,13,mango,10,13,blue,10,13,banana,10,13,pink,10,13,orange" y = Split(txt, ",10,13,") For i = 0 To UBound(y) Debug.Print y(i) Next i End Sub In this code i use (,10,13,) as a split mark and the output shows as debug.print.My idea is i want to show it in two textboxes which are textbox1 for fruit while textbox2 for colour.But i don't know how to do it.So i hope you can help me
 
#1
    ginolard

    • Total Posts : 1347
    • Scores: 23
    • Reward points : 0
    • Joined: 8/11/2005
    • Status: offline
    Re:sorting data Wednesday, August 25, 2010 12:24 AM (permalink)
    0
     Private Sub Command1_Click() 
     Dim txt As String 
     Dim y As Variant 
     Dim i As Long 
     txt = "apple,10,13,yellow,10,13,mango,10,13,blue,10,13,banana,10,13,pink,10,13,orange" 
     y = Split(txt, ",10,13,")   
     For i = 0 To UBound(y) 
     Debug.Print y(i) 
     Next i 
     End Sub
     


    Firstly, please post in the correct forum.  This one is for people to share scripts they have written.  Secondly, that looks like VB.NET code and this is a VBscript/Powershell site.
    Thirdly, please use the CODE tags so that your code is nicely formatted (as above)

    Lastly, why are you storing values like that in a string?  There are much better ways of doing that sort of thing in .NET


    Author of ManagePC - http://managepc.net

     
    #2

      Online Bookmarks Sharing: Share/Bookmark

      Jump to:

      Current active users

      There are 0 members and 1 guests.

      Icon Legend and Permission

      • New Messages
      • No New Messages
      • Hot Topic w/ New Messages
      • Hot Topic w/o New Messages
      • Locked w/ New Messages
      • Locked w/o New Messages
      • Read Message
      • Post New Thread
      • Reply to message
      • Post New Poll
      • Submit Vote
      • Post reward post
      • Delete my own posts
      • Delete my own threads
      • Rate post

      2000-2012 ASPPlayground.NET Forum Version 3.9