Results 1 to 4 of 4

Thread: Vbscript search array

  1. #1
    Join Date
    Apr 2009
    Posts
    97

    Vbscript search array

    I'm looking for search array in Vbscript. So, can any body tell me that where would i find vbscript search array? Where can i find it in Vbscript? Does any body knows about it?? Kindly provide me the correct solution for the above issue. Would be grateful to you, if any body provide me the correct solution for the above issue.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Vbscript search array

    I'm not sure about the particular code, but may work out for you.

    Dim sSearchString 'as String
    Dim MyArray(3) 'as String
    MyArray(1) = "Group1"
    MyArray(2) = "Group2"
    MyArray(3) = "Group3"
    sSearchString = "Group2"

    For a = 1 to UBound(MyArray)
    If MyArray(a) = sSearchString Then MsgBox MyArray(a)
    Next

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: Vbscript search array

    I think you need to create a zero-based string array by using the Split function. The Join function is used to reassemble the string after applying the Filter function. The Filter function searches the elements of a zero-based array, to match a pattern of one or more characters, and creates a new array, either with or without the elements containing the matched pattern.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Vbscript search array

    For that i think you can use ASP Vbscript Array filter function. As in ASP, vbscript array filter function enables you to search the array items based on the filter criteria. Vbscript filter function returns the vbscript array having matched items containing the specified string pattern. You can control the result output of vbscript filter function whether you want to include the matched items in the output vbscript array or exclude the matched items. Further in ASP Vbscript code you can use the vbscript for loop or for each loop to read the array items at each index.

Similar Threads

  1. Replies: 6
    Last Post: 08-06-2011, 11:36 PM
  2. Replies: 4
    Last Post: 05-04-2011, 04:29 AM
  3. Assigning an array to an array
    By MACE in forum Software Development
    Replies: 3
    Last Post: 18-11-2009, 05:19 PM
  4. Search Companion text search folder doesn't find all files
    By Hrishia in forum Windows XP Support
    Replies: 2
    Last Post: 27-11-2008, 10:16 PM
  5. Replies: 0
    Last Post: 07-11-2008, 02:15 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,173,625.26995 seconds with 16 queries