Jump to content

Nested for - inner for skipped


Recommended Posts

Dear everybody,

i have created a function that searches for a string in an array and starting from that point(index), stores in another array the following 26 items.

Func FileSearch($sStringToSearch)
    $k=0
    $count_search=0
    For $count = 0 To UBound($content_array) - 1
            $search_result=StringInStr($content_array[$count],$sStringToSearch)
                If $search_result<>0  Then
                    $count_search+=1
                    ReDim $SearchOnlineActivation[$count_search][$k] ;Adding a row
                    MsgBox($MB_OK, "rows", UBound($SearchOnlineActivation, $UBOUND_ROWS))
                    For $k=0 To 25
                        ReDim $SearchOnlineActivation[$count_search][$k +1] ;Adding a column
                        $SearchOnlineActivation [$count_search -1][$k] = $content_array[$count]
                        $k+=1
                        ;_ArrayDisplay($SearchOnlineActivation)
                        Next
                EndIf
    Next
EndFunc

 

The problem starts at this Point:

$SearchOnlineActivation [$count_search -1][$k] = $content_array[$count]

I insert a search_result in a cell of the 2D Array, but it "crashes". (Array variable has incorrect number of subscripts or subscript dimension range exceeded.)

Edited by LoneWolf_2106
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...