Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 686

assigning some elements in an array to another array... Please Help

$
0
0
I'm hoping this is a stupid question that can be answered rather quickly and easily.

So here what I'm trying to do. I want to take a 1 dimensional array that is already full and pass it through a for loop and when ever there is a match to my if statement.
It will copy that element out of the array and put it in a new array.

Here is a example of my code:

Public GlobalArray() As String

Dim aryText() As String
aryText = Inputfile <----- This is where the live rile was passed to the array

Dim newstr_count As Integer = UBound(aryText)

For z = 0 To newstr_count - 1

If aryText(z).Trim = "copy I'm looking to extract from the array"

GlobalArray = (aryText(z), z) '<------- Here is where I can't figure out how to pass the elements I want to keep to another array

z = z + 1
End if

next z

Thank you in advance for your help!
Chris

Viewing all articles
Browse latest Browse all 686

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>