Aceguy Posted November 18, 2007 Posted November 18, 2007 i have $array_a :- $array_a[1] = a $array_a[2] = b $array_a[3] = c $array_a[4] = d $array_a[5] = e and $array_b : $array_b[1] = b $array_b[2] = d $array_b[3] = e i want to exctract $array_b FROM $array_a so the results will be :- $array_a[1] = a $array_a[2] = c Hope this makes sense, thanks [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock
Kickassjoe Posted November 18, 2007 Posted November 18, 2007 How did you get the results? Makes no sense to me... What goes around comes around... Payback's a bitch.
Aceguy Posted November 18, 2007 Author Posted November 18, 2007 EDIT: i want to DELETE $array_b FROM $array_a [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock
SkinnyWhiteGuy Posted November 18, 2007 Posted November 18, 2007 #include <Array.au3> Dim $array_a[5] $array_a[0] = "a" $array_a[1] = "b" $array_a[2] = "c" $array_a[3] = "d" $array_a[4] = "e" Dim $array_b[3] $array_b[0] = "b" $array_b[1] = "d" $array_b[2] = "e" Dim $array_c = _ArrayExtract($array_a, $array_B) _ArrayDisplay($array_c) Func _ArrayExtract($Array1, $Array2) Dim $Array3[1], $Found For $i = 0 To UBound($Array1)-1 $Found = False For $j = 0 To UBound($Array2)-1 If $Array1[$i] == $Array2[$j] Then $Found = True EndIf Next If Not $Found Then ReDim $Array3[UBound($Array3)+1] $Array3[0] += 1 $Array3[UBound($Array3)-1] = $Array1[$i] EndIf Next Return $Array3 EndFunc Couldn't think of a better name for it, but it does what you want. It returns arrays like StringSplit() does, [0] element is the count of the rest of the items.
Aceguy Posted November 18, 2007 Author Posted November 18, 2007 thanks i will try this in my script [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now