2d Array VB6
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: 2d Array VB6

  1. #1
    Join Date
    Sep 2014
    Posts
    2

    2d Array VB6

    this is my array

    strBooks(0, 0) = "Learning Visual Basic"
    strBooks(0, 1) = "John Smith"
    strBooks(1, 0) = "Visual Basic in 1 Week"
    strBooks(1, 1) = "Bill White"
    strBooks(2, 0) = "Everything about Visual Basic"
    strBooks(2, 1) = "Mary Green"
    strBooks(3, 0) = "Programming Made Easy"
    strBooks(3, 1) = "Mark Wilson"
    strBooks(4, 0) = "Visual Basic 101"
    strBooks(4, 1) = "Alan Woods"

    the question is If someone write author of the book on textbox then click commandbutton, I want to display on msgbox the "msg" is author of the book and the "title" is title of the book.

    Anyone can help me with the code for that.

  2. #2
    DataMiser is offline Super Moderator Power Poster
    Join Date
    Jul 2008
    Location
    WV
    Posts
    4,860

    Re: 2d Array VB6

    You could loop through your array and find which one matches the author
    Code:
    For x =0 to 4
        If strBooks(x,1)=text1.text Then
             Title=strBooks(x,9)
             Author=strBooks(x,1)
       End If
    Next
    Always use [code][/code] tags when posting code.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center