반응형

    Function ARRAYMERGE( arr1, arr2 )

        dim arr1_size, arr2_size, total_size, i, counter

        

        if not isArray( arr1 ) then 

            arr1 = Array( arr1 )

        end if

        

        if not isArray( arr2 ) then 

            arr2 = Array( arr2 )

        end if

        

        arr1_size = ubound( arr1 ) : arr2_size = ubound( arr2 )

        total_size = arr1_size + arr2_size + 1

        counter = arr1_size + 1

        

        Redim Preserve arr1( total_size )

        For i = lbound( arr2 ) to arr2_size

            If isobject( arr2( i ) )then

                set arr1( counter ) = arr2( i )

            Else

                arr1( counter ) = arr2( i )

            End if

            counter = counter + 1

        Next

        ARRAYMERGE = arr1

    End Function

반응형
Posted by Hippalus
,